Skip to content

Conversation

chriscollins3456
Copy link
Collaborator

This is a first step PR to get displaying available ingestion sources in the UI dynamic. Right now everything is done on the frontend with a handwritten json file. However, that's just a stub until we eventually build out the ability to fetch this data dynamically to always keep the UI up to date.

Instead of relying on a file for each source with its configs, define these configs in a mock json file. Then create a mapper from source urn to source logo for displaying in the UI. Also creates a custom hook to check for this logo in the map in memory and if it's not there, fetch it from the backend.

Finally this updates our docs to add one final step to the guide on adding a new ingestion source - what to do in order to get that source to show up in the frontend.

This PR also adds 10 new sources:

  • superset
  • athena
  • sql server
  • clickhouse
  • trino
  • druid
  • metabase
  • mariadb
  • power bi
  • mode

The next PR will be deleting all of the source config files and moving any dependencies on them. I thought it was cleaner to do this + that in separate PRs.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions
Copy link

github-actions bot commented Aug 31, 2022

Unit Test Results (metadata ingestion)

       8 files         8 suites   57m 11s ⏱️
   692 tests    689 ✔️ 3 💤 0
1 384 runs  1 378 ✔️ 6 💤 0

Results for commit 9d1b31e.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Aug 31, 2022

Unit Test Results (build & test)

571 tests  ±0   571 ✔️ ±0   14m 11s ⏱️ -27s
141 suites ±0       0 💤 ±0 
141 files   ±0       0 ±0 

Results for commit 9d1b31e. ± Comparison against base commit db37dd2.

♻️ This comment has been updated with latest results.

@@ -63,7 +64,8 @@ const CliBadge = styled.span`
`;

export function TypeColumn(type: string, record: any) {
const iconUrl = sourceTypeToIconUrl(type);
let iconUrl = useGetSourceLogoUrl(record.platformUrn || '');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm--- this seems overly complex. why aren't we just fetching source.platform.logoUrl in the initial data pull?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh i know. so it turns out that I don't believe that these ingestion sources often actually have a platform associated with them, so it's usually null (idk how the platform gets set on these sources), so yes I agree it would make sense to just get the logoUrl. The only thing is that here I'm trying to short-circuit and use the logo we have in memory in the react bundle before we fetch to get the image from where we host it on github somewhere.

So really this code block is almost always (if not always always?) going to return null and go to the next line to get the icon purely based on what we have in react.

[MODE_URN]: modeLogo,
};

export const SOURCE_TO_SOURCE_URN = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels wrong to me 🤔 if we are already encoding this mapping in mysql why do we need to recreate it in react?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after some help, realized that the urn is just urn:li:dataPlatform:<name> so this is no longer necessary anyways!

@anshbansal anshbansal added the product PR or Issue related to the DataHub UI/UX label Sep 8, 2022
@chriscollins3456 chriscollins3456 merged commit 0be5c39 into datahub-project:master Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants