Skip to content

Commit 4c9ef97

Browse files
authored
feat: fix URLS (#38)
* fix: url * fix urls * fix: url * fix: url
1 parent e81e71e commit 4c9ef97

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/datapilot/core/platforms/dbt/cli/cli.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from datapilot.core.platforms.dbt.utils import load_catalog
1616
from datapilot.core.platforms.dbt.utils import load_manifest
1717
from datapilot.utils.formatting.utils import tabulate_data
18+
from datapilot.utils.utils import map_url_to_instance
1819

1920
logging.basicConfig(level=logging.INFO)
2021

@@ -138,6 +139,11 @@ def onboard(
138139

139140
response = start_dbt_ingestion(token, instance_name, dbt_core_integration_id, dbt_core_integration_environment, backend_url)
140141
if response["ok"]:
141-
click.echo("Onboarding completed successfully!")
142+
url = map_url_to_instance(backend_url, instance_name)
143+
if not url:
144+
click.echo("Manifest and catalog ingestion has started.")
145+
else:
146+
url = f"{url}/settings/integrations/{dbt_core_integration_id}/{dbt_core_integration_environment}"
147+
click.echo(f"Manifest and catalog ingestion has started. You can check the status at {url}")
142148
else:
143149
click.echo(f"{response['message']}")

src/datapilot/utils/utils.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,14 @@ def generate_partial_manifest_catalog(changed_files, base_path: str = "./"):
311311
raise Exception("Unable to generate partial manifest and catalog") from e
312312

313313

314-
if __name__ == "__main__":
315-
print("Running main")
316-
print(generate_partial_manifest_catalog([], "/Users/gaurp/Desktop/manifest.json", ""))
317-
print("Done running main")
314+
def map_url_to_instance(url, instance):
315+
# Base URLs and their corresponding patterns
316+
url_mapping = {
317+
"https://api.tryaltimate.com": f"https://{instance}.demo.tryaltimate.com",
318+
"https://api.myaltimate.com": f"https://{instance}.app.myaltimate.com",
319+
"https://api.getaltimate.com": f"https://{instance}.app.getaltimate.com",
320+
"http://localhost:8000": f"http://{instance}.localhost:3000",
321+
}
322+
323+
# Check if the URL is in the dictionary and return the corresponding instance URL
324+
return url_mapping.get(url)

0 commit comments

Comments
 (0)