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

feat:checking that the client is allowed to run against staging #124

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

javanlacerda
Copy link
Contributor

@javanlacerda javanlacerda commented Feb 16, 2024

Closes #121

Summary

One conformance requirement for the clients is that they should be able to run the commands against staging. After this PR, the clients should be able to receive the --staging token in the command line and point to staging resources.

Release Note

Updated client run function to receive staging argument.
Updated run subprocess call to pass --staging flag to clients cli when required.
Modified CLI parser to receive --staging flag
Update CLI and conformance READMEs adding staging features

Documentation

@javanlacerda javanlacerda changed the title checking that the client is allowd to run against staging feat:checking that the client is allowd to run against staging Feb 16, 2024
Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

LGTM overall, but with one broader design thought: rather than enabling individual tests to be run against staging, maybe we should allow the entire suite to be flipped between production and staging at a time?

My rationale: at least for testcases that do end-to-end signing (meaning they aren't implicitly tied to a specific instance already), we expect them to work on both instances and probably don't want to duplicate the code for both. If the entire suite supports being run in either mode (with skips where necessary for tests that are hard-baked against one or the other), then we get additional coverage against both instances for free.

Thoughts? This may be more effort than is immediately worth 🙂

test/client.py Outdated Show resolved Hide resolved
test/client.py Outdated Show resolved Hide resolved
test/client.py Outdated Show resolved Hide resolved
test/client.py Outdated Show resolved Hide resolved
test/test_simple_staging.py Outdated Show resolved Hide resolved
test/client.py Outdated Show resolved Hide resolved
Signed-off-by: javanlacerda <javanlacerda@google.com>
@jku
Copy link
Member

jku commented Feb 19, 2024

rather than enabling individual tests to be run against staging, maybe we should allow the entire suite to be flipped between production and staging at a time?

We can try that... but it may make sense to still enable just a subset of tests (the end-to-end ones) in the beginning: otherwise it might be quite a bit of work to re-create all of the test assets for staging (I assume that will be needed at least: I haven't created any of the assets)

If all (or many) tests can be run against staging, then we need to provide clients a way to enable/disable staging testing: xfail for individual tests is not viable... Some potential solutions:

  • we add some sort of suite wide xfail value for all-staging-tests or
  • we add a staging option to the GH action: this way clients can add a whole new action call to to their workflow when they are ready to test staging

I suppose the second one makes more sense?

@jku
Copy link
Member

jku commented Feb 19, 2024

Waving hands about what tests should be executed by pytest:

  • pytest --skip-signing already uses @pytest.mark.signing to skip tests: we could do something similar: if pytest gets "--staging", it could skip tests with @pytest.mark.no_staging_assets
  • for practical purposes it might be easier to start tagging the tests that will work with staging though: I think most tests do use the (production) assets
  • when/if we actually end up adding some staging assets, we need to figure out how to load the correct ones: I'm sure we can modify the make_materials*() functions at that time

@jku
Copy link
Member

jku commented Feb 19, 2024

Some of results that currently PASS when running GHA_SIGSTORE_CONFORMANCE_XFAIL="test_verify_with_trust_root test_verify_dsse_bundle_with_trust_root" pytest test --staging --skip-signing --entrypoint=$PWD/sigstore-python-conformance are likely incorrect: if the suite uses production assets against staging infra, the client-under test is going to fail as the test expects (but it's failing for the wrong reasons) .

@javanlacerda javanlacerda changed the title feat:checking that the client is allowd to run against staging feat:checking that the client is allowed to run against staging Feb 19, 2024
@woodruffw
Copy link
Member

Yeah, getting the production/staging states right will probably require a larger refactor/discussion of how we want the CI to run the suite. I'm okay with punting on that for now 🙂

docs/cli_protocol.md Outdated Show resolved Hide resolved
Signed-off-by: William Woodruff <william@yossarian.net>
Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @javanlacerda!

@woodruffw woodruffw added enhancement New feature or request component:tests Unit and integration tests labels Feb 20, 2024
@woodruffw
Copy link
Member

(CCing @jku for review as well, since I'm now the last pusher.)

@di di merged commit 4d4933e into sigstore:main Feb 20, 2024
3 checks passed
@di
Copy link
Member

di commented Feb 20, 2024

Ah, sorry @jku I merged too quickly here, please feel free to finish your review and suggest any changes if we missed something!

@haydentherapper
Copy link
Collaborator

Should we expect a significant increase in traffic to staging?

@woodruffw
Copy link
Member

Should we expect a significant increase in traffic to staging?

I don't think so -- based on current integrations, this should only run a handful of times a day on the sigstore-python, Java, etc. repos. So the traffic should be roughly the same as the existing staging tests, e.g. the ones sigstore-python does in its own CI 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:tests Unit and integration tests enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test against staging too
5 participants