8000 Sync action's logic and JSON schema · Issue #253 · typesafegithub/github-actions-typing · GitHub
[go: up one dir, main page]

Skip to content

Sync action's logic and JSON schema #253

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

Closed
krzema12 opened this issue Jan 29, 2025 · 1 comment
Closed

Sync action's logic and JSON schema #253

krzema12 opened this issue Jan 29, 2025 · 1 comment
Assignees

Comments

@krzema12
Copy link
Member
krzema12 commented Jan 29, 2025

We now have github-actions-typing.schema.json. It's not used in any way in the action's logic, for now it's there for some other use cases (e.g. validating typings in the catalog or using it in the IDE).

We'd like to reach a point where both the schema and the action's logic agree with each other in terms of certain typings being valid or not.

To be done:

  • refactor validateTypings to be able to pass the action's manifest and typings as strings, instead of having to use the file system
  • as a part of preparing the test cases, generate action manifests (on the fly) based on some typings
  • add a test that calls validateTypings and uses the "good typings" and the "bad typings" test resources + typings from the catalog and some actions to assert that both mechanisms work the same way
  • it may be necessary to adjust one or the other mechanism - let's discuss case by case
  • once both mechanisms agree, let's consider moving the schema to the root dir of the repo, to increase discoverability

CC @Vampire

@krzema12
Copy link
Member Author

What can be called in the tests, having a types manifest as string at hand:

krzema12 added a commit that referenced this issue Jan 31, 2025
Part of #253.

There may be cases where someone wants to make the users explicitly say
some single value of enum, e.g. like we discussed here:
typesafegithub/github-actions-typing-catalog#45 (comment)
This is what we already allow in the schema.
krzema12 added a commit that referenced this issue Jan 31, 2025
Part of
#253.

Empty `inputs:` or `outputs:` are sometimes used, just to show that no
inputs/outputs are defined.
We also allow it in the schema.
krzema12 added a commit to typesafegithub/github-workflows-kt that referenced this issue Jan 31, 2025
krzema12 added a commit that referenced this issue Jan 31, 2025
Part of
#253.

Fixes several failing test cases identified in
#261,
getting us closer to being consistent with the schema.
krzema12 added a commit that referenced this issue Jan 31, 2025
Part of #253.

It brings consistency with the rules defined in the schema.
krzema12 added a commit that referenced this issue Feb 1, 2025
Part of
#253.
Fixes two discrepancies in the test that checks consistency between the
action's logic and the schema.
krzema12 added a commit that referenced this issue Feb 2, 2025
Part of #253.

---------

Co-authored-by: Piotr Krzemiński <3110813+krzema12@users.noreply.github.com>
@krzema12 krzema12 closed this as completed Feb 2, 2025
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

No branches or pull requests

1 participant
0