Skip to content

Add "example" generated commands (so changes to generated commands are easier to see)#18

Merged
yosifkit merged 1 commit into
docker-library:mainfrom
infosiftr:example-commands
Jan 25, 2024
Merged

Add "example" generated commands (so changes to generated commands are easier to see)#18
yosifkit merged 1 commit into
docker-library:mainfrom
infosiftr:example-commands

Conversation

@tianon
Copy link
Copy Markdown
Member

@tianon tianon commented Jan 25, 2024

See #17 (comment)

Realizing we could (ab)use our sources.json and builds.json test suite to generate some example commands in the repo itself so that changes like this actually show what the pull/build/push command change is (and helps illustrate why the changes are being made). 👀

@tianon tianon requested a review from yosifkit as a code owner January 25, 2024 23:36
Comment thread .test/example-commands.sh
Comment thread .test/test.sh
# (see "library/" and ".external-pins/" for where these come from / are hard-coded for consistent testing purposes)
# NOTE: we are explicitly *not* pinning "golang:1.19-alpine3.16" so that this also tests unpinned parent behavior (that image is deprecated so should stay unchanging)

time bashbrew fetch "$@"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Splitting this out from being implied by sources.sh would've made PRs like #16 more interesting (because we'd see the actual change in generation time, not affected by Git fetch time), but we're doing such a small set here that it's really not much of a difference. 😄

Comment thread .test/test.sh
[
first(.[] | select(normalized_builder == "buildkit")),
first(.[] | select(normalized_builder == "classic")),
first(.[] | select(normalized_builder == "oci-import")),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It seems like this would select three builds, but there are only two sets of commands generated. Is this because there are no oci-import examples yet?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, that's correct -- I had originally left a # TODO oci-import here, but realized I could just add the conditional and it would match as soon as there was an example in the test data (which I plan to add when I have an implementation in meta.jq).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

(In other words, this is currently a very fancy and computational way to spell empty 😂)

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

Successfully merging this pull request may close these issues.

3 participants