Skip to content
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

Store action typings in YAMLs #407

Closed
krzema12 opened this issue Aug 15, 2022 · 2 comments · Fixed by #525
Closed

Store action typings in YAMLs #407

krzema12 opened this issue Aug 15, 2022 · 2 comments · Fixed by #525
Assignees
Labels
operational Operational Excellence - maintenance tasks.
Milestone

Comments

@krzema12
Copy link
Member

krzema12 commented Aug 15, 2022

Currently the typings are stored in https://github.com/krzema12/github-actions-kotlin-dsl/blob/main/wrapper-generator/src/main/kotlin/it/krzeminski/githubactions/wrappergenerator/WrappersToGenerate.kt

Instead, they could be stored in YAML files, according to this standard: https://github.com/krzema12/github-actions-typing

It would allow us to have the same format in both places - this library and the actions. I can even imagine some typing assistant, an application that would take an action as input, would help choose the right typings, and would finally send PRs both to this library and the action repo.

@krzema12 krzema12 added the operational Operational Excellence - maintenance tasks. label Aug 15, 2022
@krzema12 krzema12 added this to the v1 (stable) milestone Oct 16, 2022
@krzema12 krzema12 self-assigned this Oct 24, 2022
krzema12 added a commit that referenced this issue Oct 25, 2022
The practice shows that we don't set the deprecation info to another
value than the latest available version. Let's automate it this way.

This change includes a fix for a deprecation message needed for
setup-python@v2.
krzema12 added a commit that referenced this issue Oct 25, 2022
)

The practice shows that we don't set the deprecation info to another
value than the latest available version. Let's automate it this way.

This change includes a fix for a deprecation message needed for
setup-python@v2.
krzema12 added a commit that referenced this issue Oct 26, 2022
This new `actions` directory will once become the source of truth of
actions being generated.

Outputs still need to be properly typed, but it's not needed here until
someone will want to take some typings and introduce them in the action
itself.
krzema12 added a commit that referenced this issue Oct 26, 2022
This new `actions` directory will once become the source of truth of
actions being generated.

Outputs still need to be properly typed, but it's not needed here until
someone will want to take some typings and introduce them in the action
itself.
krzema12 added a commit that referenced this issue Oct 26, 2022
This new `actions` directory will once become the source of truth of
actions being generated.

Outputs still need to be properly typed, but it's not needed here until
someone will want to take some typings and introduce them in the action
itself.
krzema12 added a commit that referenced this issue Oct 28, 2022
This change is needed to more conveniently manage the typings stored in
this repository.

Some other, breaking changes were needed:
* changing `Custom` to `_Custom` for an option in sealed class when a
  given input accepts a typed value
* changing sealed classes' names, they're now inferred from the input
  name since we don't have any hint in the typings what they should be
krzema12 added a commit that referenced this issue Oct 28, 2022
This change is needed to more conveniently manage the typings stored in
this repository, and to make it coherent with
https://github.com/krzema12/github-actions-typing/.

Some inconsistencies in namings of action generated types came up, so
this change is formally a breaking one for several actions. Previously
type names were defined in this repository for each input, and now the
wrapper generator infers it from the input name. In case it's desired
to have a custom name, a feature was added to be able to specify it in
the YAML.
@krzema12
Copy link
Member Author

TODO: cleanup, there can be some surplus logic in the wrapper generator from times of having the typings stored in Kotlin.

krzema12 added a commit that referenced this issue Oct 28, 2022
This change is needed to more conveniently manage the typings stored in
this repository, and to make it coherent with
https://github.com/krzema12/github-actions-typing/.

Some inconsistencies in namings of action generated types came up, so
this change is formally a breaking one for several actions. Previously
type names were defined in this repository for each input, and now the
wrapper generator infers it from the input name. In case it's desired
to have a custom name, a feature was added to be able to specify it in
the YAML.
@krzema12
Copy link
Member Author

Before this change, if some action doesn't provide typings with https://github.com/krzema12/github-actions-typing/, they were stored in WrappersToGenerate.kt. Why it was convenient to have it in Kotlin (good IDE support), there were several problems with it:

  • it was a single, monolithic file, with no idea how to split it (per owner?). It was getting harder to navigate around it
  • it would be challenging to automatically update it, and I have plans to create extra automation around maintaining the actions
  • the typings were provided in a custom format, inconsistent with https://github.com/krzema12/github-actions-typing/. Let's say we want to move some typings from this library's repo to the actual action. It required translating it to YAML

This change introduces a new directory: actions, organized as follows:

What it means for regular users of this library: while making this change, it turned out that namings of some custom classes were a bit off. In the previous way of storing typings we had them customized, but this change revealed that the customizations don't make sense for all cases. That's why you may need to adjust your workflows to the breaking changes in the below actions:

  • azure/login@v1
  • codecov/codecov-action@v3
  • EndBug/add-and-commit@v8
  • EndBug/add-and-commit@v9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
operational Operational Excellence - maintenance tasks.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant