Skip to content

Configure subsections in the shared configuration file#10174

Closed
kdaily wants to merge 3 commits intoaws:developfrom
kdaily:feature-configure-subsections-v1
Closed

Configure subsections in the shared configuration file#10174
kdaily wants to merge 3 commits intoaws:developfrom
kdaily:feature-configure-subsections-v1

Conversation

@kdaily
Copy link
Copy Markdown
Member

@kdaily kdaily commented Mar 30, 2026

Issue #, if available:

Description of changes:

This is a port of the CLI v2 PR #10172.

See the commit messages detailing the changes and differences between the CLI v2 PR.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

kdaily added 3 commits March 30, 2026 15:48
This is a port of the following CLI v2 PR:

aws#10112

This change adds new parameters to the `aws configure get` command to
specify a sub-section for getting the value of a property. These
parameters are analogous to the existing `--profile` parameter. A
parameter will be added for each sub-section type and take a value of
the subsection name.
This is a port of the following v2 PR:

aws#10109

This change adds new parameters to the `aws configure set` command to
specify a sub-section for setting a property. These parameters are
analogous to the existing `--profile`` parameter. A parameter will be
added for each sub-section type and take a value of the subsection name.
The only sub-section types allowed are services and sso-session.

The differences here from v2 are:

- Define `get_section_header` and update `profile_to_section` to use it
  in `__init__.py`
- CLI v1 doesn't have return codes of 252, so use 255 in tests.
@kdaily kdaily requested a review from ashovlin March 30, 2026 23:23
Comment on lines +56 to +58
if profile_name == 'default':
return profile_name
return get_section_header('profile', profile_name)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Need to check if this behavior is appropriate for CLI v1.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 96.38554% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.42%. Comparing base (c4681b5) to head (506ffc0).
⚠️ Report is 232 commits behind head on develop.

Files with missing lines Patch % Lines
awscli/customizations/configure/get.py 94.87% 2 Missing ⚠️
awscli/customizations/configure/__init__.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #10174      +/-   ##
===========================================
+ Coverage    93.39%   93.42%   +0.03%     
===========================================
  Files          210      210              
  Lines        17052    17270     +218     
===========================================
+ Hits         15925    16135     +210     
- Misses        1127     1135       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

# A map between the command line parameter name and the name used
# in the full config object.
SUBSECTION_TYPE_ALLOWLIST = {
'sso-session': {"full_config_name": "sso_sessions"},
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Should we remove this, since SSO sessions are only supported in CLI v2?

'action': 'store',
'cli_type_name': 'string', 'positional_arg': True},
{
'name': 'sso-session',
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Remove since SSO sessions aren't supported?

@kdaily kdaily closed this Mar 31, 2026
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