Conversation
- Modify update_command_descriptions() to only warn when command set directory exists but descriptions file is missing - During auto-profile creation, command set directories don't exist yet, so skip warning and use debug log instead - Preserves warning behavior for established command sets where missing files indicate real issues - Reduces noise in devcontainer first setup logs while maintaining useful diagnostics Co-authored-by: Tuxliri <3532595+Tuxliri@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate this bug:
First setup of dts in devcontainer produces loads of warnings (environment variables for automatic profile creation are used)
@dts_profile_creation.log
Fix excessive warnings during auto-profile creation in devcontainer
Sep 26, 2025
Tuxliri
reviewed
Sep 26, 2025
lib/dt_shell/profile.py
Outdated
Comment on lines
+20
to
+35
| from .constants import ( | ||
| DUCKIETOWN_TOKEN_URL, | ||
| SHELL_LIB_DIR, | ||
| DEFAULT_COMMAND_SET_REPOSITORY, | ||
| DEFAULT_PROFILES_DIR, | ||
| DB_SECRETS, | ||
| DB_SECRETS_DOCKER, | ||
| DB_SETTINGS, | ||
| DB_USER_COMMAND_SETS_REPOSITORIES, | ||
| DB_PROFILES, | ||
| KNOWN_DISTRIBUTIONS, | ||
| SUGGESTED_DISTRIBUTION, | ||
| DB_UPDATES_CHECK, | ||
| EMBEDDED_COMMAND_SET_NAME, | ||
| Distro, | ||
| ) |
lib/dt_shell/profile.py
Outdated
Comment on lines
+38
to
+47
| from .utils import ( | ||
| safe_pathname, | ||
| validator_token, | ||
| yellow_bold, | ||
| cli_style, | ||
| parse_version, | ||
| render_version, | ||
| indent_block, | ||
| DebugInfo, | ||
| ) |
lib/dt_shell/profile.py
Outdated
Comment on lines
+213
to
+216
| logger.info( | ||
| f"Loading profiles from '{profiles_dir}' as prescribed by the environment " | ||
| f"variable DTSHELL_PROFILES." | ||
| ) |
lib/dt_shell/profile.py
Outdated
Comment on lines
+255
to
+258
| msg = ( | ||
| f"Loading commands from '{commands_path}' as instructed by the environment variable " | ||
| f"DTSHELL_COMMANDS." | ||
| ) |
lib/dt_shell/profile.py
Outdated
Comment on lines
+317
to
+341
| logger.warning( | ||
| f"\n -- WARNING\n\n" | ||
| + indent_block( | ||
| f"Command set '{cs.name}' wants a Duckietown Shell v{render_version(vmin)}" | ||
| f" or newer. We are running v{render_version(vnow)}.\n" | ||
| f"You will need to upgrade your shell to be able to use this command " | ||
| f"set or switch to an older version of this command set.\n" | ||
| f"This command set will now be disabled." | ||
| ) | ||
| + f"\n\n -- WARNING\n" | ||
| ) | ||
| self.command_sets.remove(cs) | ||
| # check max | ||
| if vmax is not None and vnow > vmax: | ||
| logger.warning(f"\n -- WARNING\n\n" + | ||
| indent_block( | ||
| f"Command set '{cs.name}' only supports Duckietown Shell up to " | ||
| f"v{render_version(vmax)}. We are running v{render_version(vnow)}.\n" | ||
| f"You will need to downgrade your shell to be able to use this command " | ||
| f"set or switch to a newer version of this command set.\n" | ||
| f"This command set will now be disabled." | ||
| ) + | ||
| f"\n\n -- WARNING\n") | ||
| logger.warning( | ||
| f"\n -- WARNING\n\n" | ||
| + indent_block( | ||
| f"Command set '{cs.name}' only supports Duckietown Shell up to " | ||
| f"v{render_version(vmax)}. We are running v{render_version(vnow)}.\n" | ||
| f"You will need to downgrade your shell to be able to use this command " | ||
| f"set or switch to a newer version of this command set.\n" | ||
| f"This command set will now be disabled." | ||
| ) | ||
| + f"\n\n -- WARNING\n" | ||
| ) |
lib/dt_shell/profile.py
Outdated
Comment on lines
+383
to
+387
| logger.warning( | ||
| f"Your profile is set to use the distribution '{self.settings.distro}' but this " | ||
| f"is not in the list of known distributions. Known distributions are " | ||
| f"{list(KNOWN_DISTRIBUTIONS.keys())}" | ||
| ) |
lib/dt_shell/profile.py
Outdated
Comment on lines
+433
to
+435
| logger.info( | ||
| f"Automatically selecting distribution '{d}' as it matches the profile name" | ||
| ) |
- Reverted all black formatting changes from imports and other styling - Kept only the functional change in update_command_descriptions() method - Maintains the same fix for excessive warnings during auto-profile creation - Reduces code churn by avoiding unnecessary style changes Co-authored-by: Tuxliri <3532595+Tuxliri@users.noreply.github.com>
Contributor
Author
Done in commit e4dd4b8. All formatting changes have been undone.
Addressed in commit e4dd4b8. Reverted all unnecessary formatting changes from black while preserving only the functional fix in update_command_descriptions(). |
liammcalpineduckietown
approved these changes
Sep 26, 2025
Tuxliri
approved these changes
Sep 26, 2025
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.
update_command_descriptions()is called during profile creation before command repositories are clonedShellProfile.__post_init__()when callingupdate_command_descriptions()DTShell.__init__()after profile creationRun code formatting with black to maintain project standards❌ Reverted formatting changesSummary
Fixed the excessive warnings during first setup of dts in devcontainer by making
update_command_descriptions()more intelligent about when to show warnings. Updated to address reviewer feedback by removing unnecessary formatting changes while preserving the functional fix.The fix distinguishes between:
This eliminates the noisy warning
File '/path/to/command_descriptions.yaml' does not exist.during automatic profile creation while preserving diagnostic value for real issues.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.