Skip to content

Add initial version of "Enhancements to referring to actions by commit hash" #1

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

krzema12
Copy link
Member

@krzema12 krzema12 commented Apr 27, 2025

Copy link

@Vampire Vampire left a comment

Choose a reason for hiding this comment

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

As it all-in-all is the approach I suggested, LGTM.
Just some nits. :-)

stored in the catalog are versioned by the major versions, so e.g. if a typing change is required because of a change in
the action between v1.0 and v1.1, it may be a breaking change for the Kotlin binding consumer.

To solve it, we could provide a way to freeze not only the action's commit has, but also the catalog typing's commit
Copy link

Choose a reason for hiding this comment

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

Suggested change
To solve it, we could provide a way to freeze not only the action's commit has, but also the catalog typing's commit
To solve it, we could provide a way to freeze not only the action's commit hash, but also the catalog typing's commit


```kotlin
@file:Repository("https://bindings.krzeminski.it")
@file:DependsOn("actions:checkout__commit:v4.1.2__85e6279cec87321a52edac9c87bce653a07cf6c2")
Copy link

Choose a reason for hiding this comment

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

Suggested change
@file:DependsOn("actions:checkout__commit:v4.1.2__85e6279cec87321a52edac9c87bce653a07cf6c2")
@file:DependsOn("actions:checkout___commit:v4.1.2__85e6279cec87321a52edac9c87bce653a07cf6c2")

two underscores is sub-action, three underscores is version significance

```

Additionally, the bindings server would validate if the version ref (here: `v4.1.2`) points to the mentioned commit
hash. Thanks to the extra validation, the user an extra assurance than with the YAML approach - the version is for sure
Copy link

Choose a reason for hiding this comment

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

Suggested change
hash. Thanks to the extra validation, the user an extra assurance than with the YAML approach - the version is for sure
hash. Thanks to the extra validation, the user has an extra assurance than with the YAML approach - the version is for sure


```kotlin
@file:Repository("https://bindings.krzeminski.it")
@file:DependsOn("actions:checkout__commit_lenient:v4.1.2__85e6279cec87321a52edac9c87bce653a07cf6c2")
Copy link

Choose a reason for hiding this comment

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

Suggested change
@file:DependsOn("actions:checkout__commit_lenient:v4.1.2__85e6279cec87321a52edac9c87bce653a07cf6c2")
@file:DependsOn("actions:checkout___commit_lenient:v4.1.2__85e6279cec87321a52edac9c87bce653a07cf6c2")


It's similar to the above approach, with these differences:
* the version is just used to add a comment in the YAML - no validation is performed
* the version is used to look up the typings in the catalog
Copy link

Choose a reason for hiding this comment

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

This is not really a difference.
With both approaches the typings should be lookupable in the catalog as described if the commit does not have typing information.

This mode is created to closer resemble how the YAML approach works. Because of no extra validation, it allows handling
certain edge cases, when the commit hash is intentionally out of sync with the version. For example: the version tag was
deleted because of a security vulnerability, and the user prefers to keep the action usage pinned to the commit hash to
keep the workflow working, as opposed to failing in the consistency check job.
Copy link

Choose a reason for hiding this comment

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

Suggested change
keep the workflow working, as opposed to failing in the consistency check job.
keep the workflow working, as opposed to failing in the consistency check job. Or the user wants to use a newer hash with some fix that did not make it into a release yet.

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.

2 participants