`_project.set_local_config` sets incorrect local_config_uri for GCM-enabled projects
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 52/100
Research direction
Start at the set_local_config entry point and inspect how it consumes get_gc_contributions for GCM-enabled projects. Reproduce the case with multiple matching contributions, then verify that the selected local_config_uri follows the documented depth-first ordering and that existing client behavior remains unchanged.
Written by the indexing model from the issue text.
Description
In ELM Python Client, the method set_local_config incorrectly selects the last matching contribution
from get_gc_contributions instead of the first one.
For GCM-enabled projects, this can result in returning the wrong local_config_uri.
Steps to Reproduce
- Have a project with a Global Configuration (GCM) and multiple contributions for the same project/component.
- Call:
set_local_config(name_or_uri, global_config_uri=...)
- Observe that the returned
local_config_uricorresponds to the last contribution in the flatList, not the first.
Expected Behavior
According to the official GC SDK documentation, the flatList returned by
flatListOfContributionsForGcHierarchy is depth-first ordered.
The first matching contribution should be used as it respects the "child overwrites parent" rule.
Actual Behavior
The last matching contribution is selected, which may be incorrect.
Proposed Fix
In set_local_config, break immediately after the first match:
for config in gc_contribs['configurations']:
if config['componentUri'] == self.project_uri:
config_uri = config['configurationUri']
break # first match is correct according to GC SDK
This ensures the local_config_uri is correctly selected according to the official ordering.
References
- Dominant language
- HTML
- Stars
- 52
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IBM/ELM-Python-Client
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
IBM/ELM-Python-Client#138 · 11 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
IBM/ELM-Python-Client#131 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
IBM/ELM-Python-Client#112 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
IBM/ELM-Python-Client#65 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
IBM/ELM-Python-Client#59 · 4 comments ·
All issues in IBM/ELM-Python-Client
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
speaches-ai/speaches#678 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Openbug ecr
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100