Skip to content

Comments

fix(auth check): add messaging for invalid DATAROBOT_API_TOKEN#375

Merged
ajalon1 merged 2 commits intodatarobot-oss:mainfrom
ahjota:aj/auth-check-error-messaging
Feb 19, 2026
Merged

fix(auth check): add messaging for invalid DATAROBOT_API_TOKEN#375
ajalon1 merged 2 commits intodatarobot-oss:mainfrom
ahjota:aj/auth-check-error-messaging

Conversation

@ahjota
Copy link
Contributor

@ahjota ahjota commented Feb 15, 2026

RATIONALE

Was reviewing the code in #354 again and saw a couple of things to fix.

CHANGES

  • Reuse error messaging about DATAROBOT_API_TOKEN from EnsureAuthenticated() in checkCLICredentials().
  • docs

PR Automation

Comment-Commands: Trigger CI by commenting on the PR:

  • /trigger-smoke-test or /trigger-test-smoke - Run smoke tests
  • /trigger-install-test or /trigger-test-install - Run installation tests

Labels: Apply labels to trigger workflows:

  • run-smoke-tests or go - Run smoke tests on demand (only works for non-forked PRs)

Important

For Forked PRs: If you're an external contributor, the run-smoke-tests label won't work. Only maintainers can trigger smoke tests on forked PRs by applying the approved-for-smoke-tests label after security review. Please comment requesting maintainer review if you need smoke tests to run.

ahjota and others added 2 commits February 15, 2026 03:50
When dr auth check detects an invalid or expired DATAROBOT_API_TOKEN environment variable, it now provides clear instructions on how to unset it for both Unix-like systems and Windows.

This matches the error messaging pattern already used in EnsureAuthenticated() and helps users recover from the error without needing to search documentation.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Move the platform-specific DATAROBOT_API_TOKEN unset instructions into a shared function in internal/auth to eliminate duplication between:
- EnsureAuthenticated() in internal/auth/auth.go
- checkCLICredentials() in cmd/auth/check/cmd.go

Both functions now call auth.PrintUnsetTokenInstructions() to display the same cross-platform unset command (Unix/Windows).

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@github-actions
Copy link
Contributor

🔐 Smoke tests approved by maintainer

⏳ Running security scans before executing smoke tests with secrets...

A maintainer has approved this fork PR to run smoke tests. Security scans will run first.

@github-actions
Copy link
Contributor

All smoke tests passed! (Fork PR)

✅ Security Scan: success
✅ Linux: success
✅ Windows: success

View run details

@ajalon1 ajalon1 merged commit 8afa9d2 into datarobot-oss:main Feb 19, 2026
25 checks passed
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.

3 participants