Repository navigation
fix(auth): say when auth login writes a project .dtctl.yaml - #910
Merged
discostu105 merged 2 commits intoDec 5, 2026
Merged
Conversation
auth login in a project directory is mostly a token refresh of a context the .dtctl.yaml already holds. Warn only when the login adds the context or changes its environment, token-ref or safety level.
Member
|
Thanks, the gating on One change pushed (2929a26): |
discostu105
approved these changes
Dec 5, 2026
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.
Description
ctx setandconfig set-credentialswarn when their write lands in an auto-discovered.dtctl.yaml, butauth loginwrites the same file and says nothing about it. Now it prints the same warning after the save, for both the browser and the client credentials grant.warnLocalWrite(ctx, what, path, rerun).warnLocalWriteTargetcalls it with the old--globalhint, soctx setandconfig set-credentialsprint exactly what they printed beforeauth loginafter the save, only when the config it loaded was auto-discovered--configorDTCTL_CONFIG, or when login writes the global configTwo things differ from calling
warnLocalWriteTargetas is:Log in with --config <global config path> to write there.instead ofRe-run with --global, sinceauth loginhas no--global(dtctl auth login --globalfails withunknown flag --global).--configis also how the login output and docs/CONFIGURATION.md already point at the global configconfigPath, the file login picked before the browser wait and wrote back (auth login saves the config it read before the browser wait #822). i didn't search for a.dtctl.yamlagain because that search could name a file the login didn't writewent with this hint wording to match the existing
--configmentions, can switch to something like "run it outside the project directory" if that reads better)Related Issues
Closes #824
Testing
Added
TestAuthLogin_SaysItWroteTheProjectConfig. It runsauth loginin a temp project directory with a real.dtctl.yamland global config, for the browser and the client credentials grant (IdP, token endpoint and keyring stubbed), and checks stderr for the notice with the file path and the--confighint + that the global config stays untouched. WithDTCTL_CONFIGpointing at the same file there's no notice. The two discovered-file cases fail on main.make test)make lint)