-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add ability to use OIDC to report coverage #34
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
base: master
Are you sure you want to change the base?
Conversation
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
Adds support for using an OIDC token when reporting coverage instead of a DSN.
- Define a new
use-oidc
Action input and map it inmain.py
- Append
--use-oidc
to the CLI command whenuse_oidc
is true - Simplify the CI-failure exit logic into a single conditional
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
main.py | Map use_oidc , append --use-oidc flag, and merge error logic |
action.yml | Introduce use-oidc input with description and default value |
Comments suppressed due to low confidence (1)
main.py:58
- Add a unit or integration test to verify that the
--use-oidc
flag is appended only whenuse_oidc
is set to 'true'.
if input_data["use_oidc"] == "true":
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Srijan Saurav <68371686+srijan-deepsource@users.noreply.github.com>
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 adds the ability to report coverage using OIDC by introducing a new input parameter and updating the command-line arguments for the deepsource CLI execution.
- Added a new configuration key for OIDC in main.py
- Updated the CLI command to include a new flag when OIDC is enabled
- Introduced the "use-oidc" input in action.yml to configure this behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
main.py | Added OIDC configuration and updated CLI command and error handling logic |
action.yml | Added a new input for configuring the OIDC usage |
Comments suppressed due to low confidence (1)
main.py:14
- [nitpick] Consider using a consistent naming convention for environment variable keys; if underscores are preferred, consider renaming 'INPUT_USE-OIDC' to 'INPUT_USE_OIDC'.
"use_oidc": "INPUT_USE-OIDC",
@@ -54,6 +55,9 @@ def main() -> None: | |||
input_data["coverage_file"], | |||
] | |||
|
|||
if input_data["use_oidc"] == "true": |
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.
[nitpick] Consider converting the input value to a native boolean (e.g., using a lower case conversion or a boolean cast) to simplify condition checking and mitigate case sensitivity issues.
if input_data["use_oidc"] == "true": | |
if input_data["use_oidc"]: |
Copilot uses AI. Check for mistakes.
@@ -18,6 +18,10 @@ inputs: | |||
description: 'HEAD commit for which the Test Coverage report is being sent' | |||
required: false | |||
default: ${{ github.event.pull_request.head.sha }} | |||
use-oidc: | |||
description: 'Use OIDC token instead of DSN. Allowed values are — true, false' |
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.
[nitpick] Clarify the 'use-oidc' input description by replacing the em dash with clear language (e.g. 'Allowed values: "true" or "false"').
Copilot uses AI. Check for mistakes.
No description provided.