refreshextracts refreshes the wrong extract if you have multiple data sources with the same name and same Project name#376
Merged
Conversation
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@v5...v6) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes refreshextracts selecting the wrong extract when multiple projects share the same leaf project name and datasource name by ensuring item lookup is disambiguated by the container project’s id (not just name).
Changes:
- Add client-side post-filtering in
Server.get_items_by_nameto only keep non-project items whoseproject_idmatches the provided container’sid. - Add early-exit and “not found after disambiguation” behavior for container-scoped lookups.
- Add unit tests covering ambiguous nested-project scenarios with identically named datasources.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
tabcmd/commands/server.py |
Adds project-id-based disambiguation logic to prevent selecting same-named items from sibling projects. |
tests/commands/test_server_item_selection.py |
Adds tests that reproduce/guard against selecting the wrong datasource when project names collide across paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
setup
MyProjects/ProjectA/Cats/my-datasource
MyProjects/ProjectB/Cats/my-datasource
MyPorjects/Cats/my-datasource
Run:
tabcmd refreshextracts --project "Cats" --parent-project-path "MyProjects/ProjectA" --datasource "my-datasource"
Note that this refreshes the expected data source: MyProjects/ProjectA/Cats/my-datasource
Run:
tabcmd refreshextracts --project "Cats" --parent-project-path "MyProjects/ProjectB" --datasource "my-datasource"
Note that this ALSO refreshes the data source: MyProjects/ProjectA/Cats/my-datasource
Run:
tabcmd refreshextracts --project "Cats" --parent-project-path "MyProjects" --datasource "my-datasource" --no-certcheck
Note that this ALSO refreshes the data source: MyProjects/ProjectA/Cats/my-datasource