Skip to content

[DCP - CLI] Update the CLI to specify the --import flag - #99

Merged
gmechali merged 14 commits into
mainfrom
cliImportName
Jun 3, 2026
Merged

[DCP - CLI] Update the CLI to specify the --import flag#99
gmechali merged 14 commits into
mainfrom
cliImportName

Conversation

@gmechali

Copy link
Copy Markdown
Contributor

No description provided.

gmechali and others added 6 commits May 29, 2026 17:08
* Added datacommons-cli and datacommons-admin readmes

* updated installation section
…ref / tag (#94)

* Updated admin init command to fetch modules with the current version ref / tag

* reverted readme changes

* feedback

* fmt

* bug fix

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several updates to the Data Commons Platform administrative and CLI tools, including the addition of an --import option to the ingestion start command, corresponding Cloud Run container overrides, updated Terraform IAM configurations, and expanded documentation. Review feedback recommends adding type annotations (str | None) to the new import_name parameters in ingest_cli.py and ingestion_job_client.py, as well as implementing unit tests to verify the parsing and payload behavior of the new --import flag.

Comment thread packages/datacommons-admin/datacommons_admin/ingest_cli.py Outdated
Comment thread packages/datacommons-admin/datacommons_admin/ingestion_job_client.py Outdated
Comment thread packages/datacommons-admin/tests/test_admin_cli.py
@gmechali

gmechali commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces CLI support for specifying specific imports to run during data ingestion, updates the Terraform templates to use version-prefixed Git refs by default, and adds comprehensive documentation for the admin and CLI packages. The reviewer feedback highlights a few minor issues: a typo in the README CLI command option (--import instead of --imports), a missing type hint for the new imports parameter in ingest_cli.py, and an outdated API key comment in a newly added test.

Comment thread infra/dcp/README.md Outdated
Comment thread packages/datacommons-admin/datacommons_admin/ingest_cli.py Outdated
Comment thread packages/datacommons-admin/tests/test_admin_cli.py Outdated
@gmechali

gmechali commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gmechali
gmechali requested a review from dwnoble June 1, 2026 17:57

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the ability to trigger data ingestion jobs with specific imports via the datacommons CLI. It updates the CLI and the underlying ingestion_job_client to pass --mode=dcpbridge and --imports as container overrides to the Cloud Run job, adds corresponding unit tests, and grants the workflow service account the roles/run.developer role. Feedback on these changes suggests retaining the default DATA_RUN_MODE environment variable in the Terraform configuration to maintain backward compatibility for other triggers, and correcting the type hint for the imports parameter in start_job to str | None.

Comment thread infra/dcp/modules/ingestion/preprocessing_job/main.tf
Comment thread packages/datacommons-admin/datacommons_admin/ingestion_job_client.py Outdated
gmechali and others added 2 commits June 1, 2026 14:14
…ent.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@gmechali
gmechali added this pull request to the merge queue Jun 3, 2026
Merged via the queue into main with commit 17482f9 Jun 3, 2026
7 checks passed
@gmechali
gmechali deleted the cliImportName branch June 3, 2026 14:56
gmechali added a commit to datacommonsorg/import that referenced this pull request Jun 3, 2026
Updates the legacy data job to support the --imports flag.
It has backwards compatibility, if --imports is not provided, we will
continue looking for the config.json in the input/dir.
Otherwise, we will be looking in the subfolders provided.

CLI is updated in datacommonsorg/datacommons#99

Note that this supports following thepath in GCS to make the provenance
name, but it does not yet support per-import feature yet. We currently
hack te provenance name of multiple different imports. The work needed
to do this blew up the PR, so I am now splitting it up. This is JUST the
import job changes for support a --imports flag and fetching the
configs.

The follow up PR will add full support for multiple individual imports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants