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

re-think test.yml WRT usage in publish and cron #424

Open
jku opened this issue Sep 2, 2024 · 3 comments
Open

re-think test.yml WRT usage in publish and cron #424

jku opened this issue Sep 2, 2024 · 3 comments

Comments

@jku
Copy link
Member

jku commented Sep 2, 2024

We use test.yml workflow in multiple ways:

  • in cron: this warns maintainers if repository is not operational or if metadata in it expires too soon
  • in publish: this prevents merging changes that break the repo

The issue is that both cases use the same input values for the test action, in particular:

  • valid_days (how many days into future the repository must be valid)
  • offline_valid_days(how many days into future the offline metadata must be valid)

for the publish case we probably should use 0 for both cases

@jku
Copy link
Member Author

jku commented Sep 2, 2024

Issue came up in sigstore/root-signing-staging#179

@jku
Copy link
Member Author

jku commented Sep 2, 2024

There is a few ways to fix this:

  • add an input to the workflow (e.g. test_future_validity) and ensure that this somehow works in cron jobs
    • this has the issue that you can't set default input values for cron... so you still need the actual defaults in environment variables or code
  • or stop reusing the workflow and instead call the action directly from publish (this was originally unappealing since we then have to also call custom-test.yml in the root-signing case, so publish becomes more complicated)
  • or check if we're running in cron and only then assume we want to test future validity... this feels a bit magical

@jku
Copy link
Member Author

jku commented Sep 2, 2024

I think the last one is reasonable:

  • it means no changes to actions or the template

  • but means complicated input args in root-signing:

        # when workflow is reused in publish.yml, do not require future validity
        valid_days:  ${{ github.event_name == 'workflow_call' && 0 || 3 }}
    

It's really ugly but maybe acceptable..

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