Skip to content

add inputs used by autosubmission #87

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

Merged
merged 16 commits into from
May 30, 2025
Merged

add inputs used by autosubmission #87

merged 16 commits into from
May 30, 2025

Conversation

elrayle
Copy link
Contributor

@elrayle elrayle commented May 27, 2025

Description

Adding inputs for autosubmission and passing them through to the snapshot submission call.

New Inputs:

  • snapshot-sha
  • snapshot-ref
  • detector-name
  • detector-version
  • detector-url

Backward Compatibility

All new inputs are optional. If any of detector-name, detector-version, or detector-url, they all are required.

If only one or two are provided, an error is raised.

If none are specified, then the hardcoded values used prior to this PR are used as default values. This maintains backward compatibility for anyone using this action directly.

@Copilot Copilot AI review requested due to automatic review settings May 27, 2025 22:10
@elrayle elrayle requested a review from a team as a code owner May 27, 2025 22:10
Copy link

@Copilot Copilot AI left a 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 optional inputs for autosubmission metadata and forwards them into the snapshot submission call, while preserving backward compatibility.

  • Introduces a SnapshotDetector type and logic to read detector-name, detector-version, and detector-url inputs (with defaults if none provided).
  • Adds snapshot-sha and snapshot-ref inputs and assigns them to the Snapshot object.
  • Updates action.yml to declare all five new inputs.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/index.ts Added SnapshotDetector type, parsed detector and snapshot inputs, and assigned sha/ref.
action.yml Declared new inputs: snapshot-sha, snapshot-ref, detector-*.
Comments suppressed due to low confidence (1)

src/index.ts:113

  • The new code paths for setting snapshot.sha and snapshot.ref are not covered by existing tests. Consider adding unit or integration tests to verify these inputs are correctly read and assigned.
snapshot.sha = core.getInput('snapshot-sha')

Copy link
Contributor

@ljones140 ljones140 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see a few places where we need to derive the default if not provided by the inputs

Copy link

@indigok indigok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🙌🏻

@elrayle elrayle merged commit 5cde65f into main May 30, 2025
3 checks passed
@elrayle elrayle deleted the elr/inputs branch May 30, 2025 02:08
const inputSHA = core.getInput('sha')
if (inputSHA !== '') {
snapshot.sha = inputSHA
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, good to see this backwards compatibility

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