-
Notifications
You must be signed in to change notification settings - Fork 11
feat: use TF API to detect TF scope from API key #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
`tf_scope` input is now deprecated and will be removed in the future. The value of `tf_scope` is now ignored and whoami API endpoint is used to detect the scope. Fixes sclorg#315
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #329 +/- ##
==========================================
- Coverage 91.58% 91.56% -0.02%
==========================================
Files 14 14
Lines 867 865 -2
Branches 162 161 -1
==========================================
- Hits 794 792 -2
Misses 73 73 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
[test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR automates the detection of Testing Farm scope by using the Testing Farm API's whoami endpoint instead of requiring users to manually specify the tf_scope input. The tf_scope input is now deprecated and will be removed in a future version.
- Upgraded
testing-farmpackage from v1.11.0 to v1.12.0 to gain access to the newwhoamiAPI endpoint - Removed the
tfScopeSchemavalidation and replaced manual scope parsing with automatic detection viaapi.whoami().token.ranch - Updated tests to mock the
whoamiAPI endpoint responses
Reviewed Changes
Copilot reviewed 6 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Upgraded testing-farm dependency to 1.12.0 |
| yarn.lock | Updated lock file with new testing-farm version and checksum |
| src/schema/input.ts | Removed deprecated tfScopeSchema export |
| src/action.ts | Replaced manual tf_scope parsing with api.whoami() call |
| tests/action.test.ts | Added whoami mock for both public and private ranch scenarios |
| action.yml | Added deprecation message for tf_scope input |
| README.md | Updated documentation to indicate tf_scope is deprecated |
| dist/* | Built distribution files reflecting source changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Testing Farm results
|
tf_scopeinput is now deprecated and will be removed in the future. The value oftf_scopeis now ignored, and the whoami API endpoint is used to detect the scope.Fixes #315