Skip to content

Commit

Permalink
internal/e2e: test that we can't replace published versions
Browse files Browse the repository at this point in the history
We were pretty sure that registry.cue.works already forbade this,
but we didn't have a proper end-to-end test for it yet.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: If17d595480771be0c5678edeb36ef97af986d172
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1178252
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Paul Jolly <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
mvdan committed Mar 13, 2024
1 parent ba698de commit d1104bd
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions internal/e2e/testdata/script/github_app_public.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,30 @@ cmp stdout export.golden
# TODO(mvdan): Use another registry token without access to this private repo
# and check that they can list and fetch, but not publish, any versions.

# Trying to publish the same version again with the same contents should succeed.
cd ../publish
exec cue mod publish ${VERSION}

# Trying to publish the same version again with different contents should fail.
# TODO: Note that the error does say the repository has enabled tag immutability,
# but that error message comes from Google Cloud, not from our registry service,
# so it's not a stable string. We should give the user a short and stable error,
# and test for it here with a regular expression.
cd ../publish-different
exec cue mod init ${MODVER}
! exec cue mod publish ${VERSION}
stderr 'cannot tag.*400 Bad Request'

-- publish/foo.cue --
package publish

foo: "foo value"

-- publish-different/foo.cue --
package publish

foo: "different foo value"

-- depend/out_foo.cue --
package depend

Expand Down

0 comments on commit d1104bd

Please sign in to comment.