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

Add action typing #109

Closed
krzema12 opened this issue Feb 1, 2023 · 15 comments · Fixed by #110
Closed

Add action typing #109

krzema12 opened this issue Feb 1, 2023 · 15 comments · Fixed by #110
Assignees
Labels
📃 documentation Improvements or additions to documentation

Comments

@krzema12
Copy link

krzema12 commented Feb 1, 2023

I'm looking to get your action first-class supported by https://github.com/krzema12/github-workflows-kt, a Kotlin DSL to write GitHub Action workflows.

They came up with a way to reduce operational load when keeping library's action wrappers in sync with actions' inputs and outputs. The solution includes onboarding https://github.com/krzema12/github-actions-typing. It's as easy as adding an extra YAML file to your repository root, and adding a simple GitHub workflow that validates this new file. Thanks to this, the code generator in the Kotlin DSL can fetch typing info provided by you instead of them, which has a number of benefits. It has no negative effects on current action consumers, they continue to use the action via regular GitHub API, as if the file wasn't there.

In this feature request, I would like to ask you if you're open to introducing such typings in your action. You wouldn't be first - there're already other actions using it, like e.g.: https://github.com/Vampire/setup-wsl or https://github.com/ReactiveCircus/android-emulator-runner (full list here).

If your answer is "yes", feel free to either add it yourself, or let me know - me or some of the library contributors would be happy to post a PR. They're also open to any kind of questions and feedback.

@timheuer
Copy link
Member

timheuer commented Feb 1, 2023

Hi @krzema12 thank you for submitting an issue here. We will decline at this time to include this in this repo. This action is very focused and we desire to keep the source here focused on the specific task.

@timheuer timheuer closed this as completed Feb 1, 2023
@krzema12
Copy link
Author

krzema12 commented Feb 2, 2023

@timheuer I believe we have a misunderstanding here. Adding the typings won't make the action less focused in any way, and instead it will make it easier for certain users to consume the action. Think of it like of an extra piece of metadata. You also don't have to worry about me mentioning Kotlin - the typings are language/technology-agnostic and can be consumed by a .NET-based code as well.

@Vampire
Copy link
Contributor

Vampire commented Feb 2, 2023

@timheuer let me also chime in as an early adopter.

The only change and effect on your action is an additional file action-types.yml where you formally describe the types of inputs and outputs of your action, instead of just using prose.
(Usually you also have one additional GitHub workflow that does some consistency checks for the type file.)

This allows consumers of your action to see exactly and unambiguously which types your action expects and provides.

Additionally it allows libraries like github-workflows-kt (which allows to write GitHub Workflow files in Kotlin instead of YAML) to process these type information programmatically to automatically generate a class so that users of that library can easily and type-safely use your action.

@LeoColman
Copy link

My two cents as an early adopter and a contributor that tries to onboard action-types.yml to other repositories:

The only change and effect on your action is an additional file action-types.yml where you formally describe the types of inputs and outputs of your action, instead of just using prose.

This point is utmost. I'd kindly suggest you to reconsider "This action is very focused" @timheuer, as this change stabilizes the action even more!

@timheuer
Copy link
Member

timheuer commented Feb 2, 2023

My understanding based on looking is this would require an additional workflow to be executed on this repo. Is that not the case?

@krzema12
Copy link
Author

krzema12 commented Feb 2, 2023

The workflow is not strictly required, but highly recommended to ensure the typings are valid and that they match the inputs from action.yml. It's a very simple workflow. Is it problematic in any way? It still doesn't influence the complexity of the action itself.

@Vampire
Copy link
Contributor

Vampire commented Feb 2, 2023

It's not necessary, it just makes sense.
The action checks whether the inputs and outputs are in sync and that the used types are vaild.
But you could theoretically do without.
But actually how does running an additional workflow make this action less focused? :-/

@timheuer
Copy link
Member

timheuer commented Feb 2, 2023

There is a bit more overhead for compliance on this repo -- it's maintained by 2 people and not our primary roles, so we're not eager to add things that cause more overhead for us ;-). I'll take a re-look at adding the types (PR is appreciated) but would not likely add a workflow to the repo.

@timheuer timheuer reopened this Feb 2, 2023
@timheuer timheuer self-assigned this Feb 2, 2023
@timheuer timheuer added the 📃 documentation Improvements or additions to documentation label Feb 2, 2023
Vampire added a commit to Vampire/setup-msbuild that referenced this issue Feb 2, 2023
@Vampire
Copy link
Contributor

Vampire commented Feb 2, 2023

There you have it :-)

Vampire added a commit to Vampire/setup-msbuild that referenced this issue Feb 3, 2023
timheuer added a commit that referenced this issue Feb 3, 2023
Implement #109 adding action types file and fixes #111 as well
@krzema12
Copy link
Author

krzema12 commented Feb 3, 2023

Thanks! 🙇

@krzema12
Copy link
Author

krzema12 commented Feb 3, 2023

@timheuer for this to work on our end, this change needs to be released, i. e. available from your major version tag. Are you planning to release soon? If not, could you do it?

@timheuer
Copy link
Member

timheuer commented Feb 3, 2023

I'll see if I can push a release later today...in a bunch of meetings for a bit.

@timheuer
Copy link
Member

timheuer commented Feb 3, 2023

Released 1.3.1 and updated v1/v1.3 tags

@Gakk
Copy link

Gakk commented Feb 6, 2023

@timheuer I see that version 1.3.1 is tagged, but it is not created as a release on GitHub. Have you stopped creating releases?

This results in @dependabot pull requests being without release notes 😲

@timheuer
Copy link
Member

timheuer commented Feb 6, 2023

@Gakk - yes, sorry...will try to be better here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📃 documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants