-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ingest): add ingestion source for SAP Analytics Cloud #10958
Merged
hsheth2
merged 9 commits into
datahub-project:master
from
Masterchen09:feat-sap-analytics-cloud
Aug 26, 2024
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7d5ee53
feat(ingest): add ingestion source for SAP Analytics Cloud
Masterchen09 a07233a
adjustments after code review
Masterchen09 74e0c7f
added config to control ingestion of schema metadata of Import Data M…
Masterchen09 3dd7c06
fixed a typo
Masterchen09 1db83a3
Merge branch 'master' into feat-sap-analytics-cloud
hsheth2 1347cd6
fix mutations/ingestion_source.js test
Masterchen09 5d7b4fb
fix hashability of frozen Resource dataclass (use FrozenSet instead o…
Masterchen09 ee22f17
fix mutations/managing_secrets.js test
Masterchen09 53ab0d8
Merge branch 'master' into feat-sap-analytics-cloud
hsheth2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
161 changes: 161 additions & 0 deletions
161
datahub-web-react/src/app/ingest/source/builder/RecipeForm/sac.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
import { RecipeField, FieldType, setListValuesOnRecipe } from './common'; | ||
|
||
export const SAC_TENANT_URL: RecipeField = { | ||
name: 'tenant_url', | ||
label: 'Tenant URL', | ||
tooltip: 'The URL of the SAP Analytics Cloud tenant.', | ||
type: FieldType.TEXT, | ||
fieldPath: 'source.config.tenant_url', | ||
placeholder: 'https://company.eu10.sapanalytics.cloud', | ||
required: true, | ||
rules: null, | ||
}; | ||
|
||
export const SAC_TOKEN_URL: RecipeField = { | ||
name: 'token_url', | ||
label: 'Token URL', | ||
tooltip: 'The OAuth 2.0 Token Service URL.', | ||
type: FieldType.TEXT, | ||
fieldPath: 'source.config.token_url', | ||
placeholder: 'https://company.eu10.hana.ondemand.com/oauth/token', | ||
required: true, | ||
rules: null, | ||
}; | ||
|
||
export const SAC_CLIENT_ID: RecipeField = { | ||
name: 'client_id', | ||
label: 'Client ID', | ||
tooltip: 'Client ID.', | ||
type: FieldType.SECRET, | ||
fieldPath: 'source.config.client_id', | ||
placeholder: 'client_id', | ||
required: true, | ||
rules: null, | ||
}; | ||
|
||
export const SAC_CLIENT_SECRET: RecipeField = { | ||
name: 'client_secret', | ||
label: 'Client Secret', | ||
tooltip: 'Client Secret.', | ||
type: FieldType.SECRET, | ||
fieldPath: 'source.config.client_secret', | ||
placeholder: 'client_secret', | ||
required: true, | ||
rules: null, | ||
}; | ||
|
||
export const INGEST_STORIES: RecipeField = { | ||
name: 'ingest_stories', | ||
label: 'Ingest Stories', | ||
tooltip: 'Whether stories should be ingested into DataHub.', | ||
type: FieldType.BOOLEAN, | ||
fieldPath: 'source.config.ingest_stories', | ||
rules: null, | ||
section: 'Stories and Applications', | ||
}; | ||
|
||
export const INGEST_APPLICATIONS: RecipeField = { | ||
name: 'ingest_applications', | ||
label: 'Ingest Applications', | ||
tooltip: 'Whether applications should be ingested into DataHub.', | ||
type: FieldType.BOOLEAN, | ||
fieldPath: 'source.config.ingest_applications', | ||
rules: null, | ||
section: 'Stories and Applications', | ||
}; | ||
|
||
const resourceIdAllowFieldPath = 'source.config.resource_id_pattern.allow'; | ||
export const RESOURCE_ID_ALLOW: RecipeField = { | ||
name: 'resource_id_pattern.allow', | ||
label: 'Resource Id Allow Patterns', | ||
tooltip: | ||
'Only include specific Stories and Applications by providing the id of the ressource, or a Regular Expression (REGEX). If not provided, all Stories and Applications will be included.', | ||
type: FieldType.LIST, | ||
buttonLabel: 'Add pattern', | ||
fieldPath: resourceIdAllowFieldPath, | ||
rules: null, | ||
section: 'Stories and Applications', | ||
placeholder: 'LXTH4JCE36EOYLU41PIINLYPU9XRYM26', | ||
setValueOnRecipeOverride: (recipe: any, values: string[]) => | ||
setListValuesOnRecipe(recipe, values, resourceIdAllowFieldPath), | ||
}; | ||
|
||
const resourceIdDenyFieldPath = 'source.config.resource_id_pattern.deny'; | ||
export const RESOURCE_ID_DENY: RecipeField = { | ||
name: 'resource_id_pattern.deny', | ||
label: 'Resource Id Deny Patterns', | ||
tooltip: | ||
'Exclude specific Stories and Applications by providing the id of the resource, or a Regular Expression (REGEX). If not provided, all Stories and Applications will be included. Deny patterns always take precendence over Allow patterns.', | ||
type: FieldType.LIST, | ||
buttonLabel: 'Add pattern', | ||
fieldPath: resourceIdDenyFieldPath, | ||
rules: null, | ||
section: 'Stories and Applications', | ||
placeholder: 'LXTH4JCE36EOYLU41PIINLYPU9XRYM26', | ||
setValueOnRecipeOverride: (recipe: any, values: string[]) => | ||
setListValuesOnRecipe(recipe, values, resourceIdDenyFieldPath), | ||
}; | ||
|
||
const resourceNameAllowFieldPath = 'source.config.resource_id_pattern.allow'; | ||
export const RESOURCE_NAME_ALLOW: RecipeField = { | ||
name: 'resource_name_pattern.allow', | ||
label: 'Resource Name Allow Patterns', | ||
tooltip: | ||
'Only include specific Stories and Applications by providing the name of the ressource, or a Regular Expression (REGEX). If not provided, all Stories and Applications will be included.', | ||
type: FieldType.LIST, | ||
buttonLabel: 'Add pattern', | ||
fieldPath: resourceNameAllowFieldPath, | ||
rules: null, | ||
section: 'Stories and Applications', | ||
placeholder: 'Name of the story', | ||
setValueOnRecipeOverride: (recipe: any, values: string[]) => | ||
setListValuesOnRecipe(recipe, values, resourceNameAllowFieldPath), | ||
}; | ||
|
||
const resourceNameDenyFieldPath = 'source.config.resource_name_pattern.deny'; | ||
export const RESOURCE_NAME_DENY: RecipeField = { | ||
name: 'resource_name_pattern.deny', | ||
label: 'Resource Name Deny Patterns', | ||
tooltip: | ||
'Exclude specific Stories and Applications by providing the name of the resource, or a Regular Expression (REGEX). If not provided, all Stories and Applications will be included. Deny patterns always take precendence over Allow patterns.', | ||
type: FieldType.LIST, | ||
buttonLabel: 'Add pattern', | ||
fieldPath: resourceNameDenyFieldPath, | ||
rules: null, | ||
section: 'Stories and Applications', | ||
placeholder: 'Name of the story', | ||
setValueOnRecipeOverride: (recipe: any, values: string[]) => | ||
setListValuesOnRecipe(recipe, values, resourceNameDenyFieldPath), | ||
}; | ||
|
||
const folderAllowFieldPath = 'source.config.resource_id_pattern.allow'; | ||
export const FOLDER_ALLOW: RecipeField = { | ||
name: 'folder_pattern.allow', | ||
label: 'Folder Allow Patterns', | ||
tooltip: | ||
'Only include specific Stories and Applications by providing the folder containing the resources, or a Regular Expression (REGEX). If not provided, all Stories and Applications will be included.', | ||
type: FieldType.LIST, | ||
buttonLabel: 'Add pattern', | ||
fieldPath: folderAllowFieldPath, | ||
rules: null, | ||
section: 'Stories and Applications', | ||
placeholder: 'Folder of the story', | ||
setValueOnRecipeOverride: (recipe: any, values: string[]) => | ||
setListValuesOnRecipe(recipe, values, folderAllowFieldPath), | ||
}; | ||
|
||
const folderDenyFieldPath = 'source.config.folder_pattern.deny'; | ||
export const FOLDER_DENY: RecipeField = { | ||
name: 'folder_pattern.deny', | ||
label: 'Folder Deny Patterns', | ||
tooltip: | ||
'Exclude specific Stories and Applications by providing the folder containing the resources, or a Regular Expression (REGEX). If not provided, all Stories and Applications will be included. Deny patterns always take precendence over Allow patterns.', | ||
type: FieldType.LIST, | ||
buttonLabel: 'Add pattern', | ||
fieldPath: folderDenyFieldPath, | ||
rules: null, | ||
section: 'Stories and Applications', | ||
placeholder: 'Folder of the story', | ||
setValueOnRecipeOverride: (recipe: any, values: string[]) => | ||
setListValuesOnRecipe(recipe, values, folderDenyFieldPath), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { SourceConfig } from '../types'; | ||
import sacLogo from '../../../../../images/saclogo.svg'; | ||
|
||
const placeholderRecipe = `\ | ||
source: | ||
type: sac | ||
config: | ||
tenant_url: # Your SAP Analytics Cloud tenant URL, e.g. https://company.eu10.sapanalytics.cloud or https://company.eu10.hcs.cloud.sap | ||
token_url: # The Token URL of your SAP Analytics Cloud tenant, e.g. https://company.eu10.hana.ondemand.com/oauth/token. | ||
|
||
# Add secret in Secrets Tab with relevant names for each variable | ||
client_id: "\${SAC_CLIENT_ID}" # Your SAP Analytics Cloud client id | ||
client_secret: "\${SAC_CLIENT_SECRET}" # Your SAP Analytics Cloud client secret | ||
`; | ||
|
||
export const SAC = 'sac'; | ||
|
||
const sacConfig: SourceConfig = { | ||
type: SAC, | ||
placeholderRecipe, | ||
displayName: 'SAP Analytics Cloud', | ||
docsUrl: 'https://datahubproject.io/docs/generated/ingestion/sources/sac/', | ||
logoUrl: sacLogo, | ||
}; | ||
|
||
export default sacConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just to push the "custom" button to the bottom, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly