-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Publish warn display env vars #12486
Conversation
908471d
to
5519810
Compare
5519810
to
084adb0
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12486 +/- ##
==========================================
+ Coverage 50.12% 50.77% +0.65%
==========================================
Files 157 156 -1
Lines 15564 15666 +102
==========================================
+ Hits 7802 7955 +153
+ Misses 6972 6929 -43
+ Partials 790 782 -8 ☔ View full report in Codecov by Sentry. |
cmd/compose/publish.go
Outdated
@@ -48,6 +49,7 @@ func publishCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Servic | |||
flags.BoolVar(&opts.resolveImageDigests, "resolve-image-digests", false, "Pin image tags to digests") | |||
flags.StringVar(&opts.ociVersion, "oci-version", "", "OCI image/artifact specification version (automatically determined by default)") | |||
flags.BoolVar(&opts.withEnvironment, "with-env", false, "Include environment variables in the published OCI artifact") | |||
flags.BoolVarP(&opts.force, "force", "f", false, "Force publish without asking for confirmation") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to use -y
to align with https://github.com/docker/compose/blob/main/cmd/compose/create.go#L84
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree will update my PR 👍
pkg/compose/publish.go
Outdated
if err != nil { | ||
return false, err | ||
} | ||
reader := bufio.NewReader(cli.In()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use UI#Confirm
from pkg/prompt package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some minor notes on UX
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
084adb0
to
9f09b89
Compare
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [docker/compose](https://github.com/docker/compose) | minor | `v2.32.4` -> `v2.33.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>docker/compose (docker/compose)</summary> ### [`v2.33.0`](https://github.com/docker/compose/releases/tag/v2.33.0) [Compare Source](docker/compose@v2.32.4...v2.33.0) #### What's Changed > \[!IMPORTANT] > This release introduce support for [Bake](https://docs.docker.com/build/bake/) to manage builds as an alternative to the internal buildkit client. This new feature can be enabled by setting `COMPOSE_BAKE=1` variable. Bake will become the default builder in a future release. ##### ✨ Improvements - let user know bake is now supported by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12524 - support additional_context reference to another service by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12485 - add support for BUILDKIT_PROGRESS by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12458 - add --with-env flag to publish command by [@​glours](https://github.com/glours) in docker/compose#12482 - Update ls --quiet help description by [@​maxproske](https://github.com/maxproske) in docker/compose#12541 - Publish warn display env vars by [@​glours](https://github.com/glours) in docker/compose#12486 ##### 🐛 Fixes - Fix bake support by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12507 - Update link in stats --help output by [@​maxproske](https://github.com/maxproske) in docker/compose#12523 - Properly handle "builtin" seccomp profile by [@​r-bk](https://github.com/r-bk) in docker/compose#12478 - manage `watch` applied to mulitple services by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12469 ##### 🔧 Internal - use main branch for docs upstream validation workflow by [@​crazy-max](https://github.com/crazy-max) in docker/compose#12487 - fix provenance for binaries and generate sbom by [@​crazy-max](https://github.com/crazy-max) in docker/compose#12479 - add codeowners file by [@​glours](https://github.com/glours) in docker/compose#12480 - remove exit code per error type used by legacy metrics system by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12502 - Dockerfile: update golangci-lint to v1.63.4 by [@​thaJeztah](https://github.com/thaJeztah) in docker/compose#12546 - Full test coverage for compatibility cmd by [@​maxproske](https://github.com/maxproske) in docker/compose#12528 - don't send raw os.Args to opentelemetry but a pseudo command line by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12530 - add docker engine v28.x to the test-matrix by [@​thaJeztah](https://github.com/thaJeztah) in docker/compose#12539 - enable copyloopvar linter by [@​thaJeztah](https://github.com/thaJeztah) in docker/compose#12542 - go.mod: remove toolchain directive by [@​thaJeztah](https://github.com/thaJeztah) in docker/compose#12551 ##### ⚙️ Dependencies - bump buildx v0.20.1 by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12488 - bump docker to v27.5.1 by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12491 - bump compose-go v2.4.8 by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12543 - bump golang.org/x/sys from 0.28.0 to 0.30.0 by [@​dependabot](https://github.com/dependabot) in docker/compose#12529 - bump github.com/moby/term v0.5.2 by [@​thaJeztah](https://github.com/thaJeztah) in docker/compose#12540 - bump github.com/otiai10/copy from 1.14.0 to 1.14.1 by [@​dependabot](https://github.com/dependabot) in docker/compose#12493 - bump github.com/jonboulle/clockwork from 0.4.0 to 0.5.0 by [@​dependabot](https://github.com/dependabot) in docker/compose#12430 - bump github.com/spf13/pflag from 1.0.5 to 1.0.6 by [@​dependabot](https://github.com/dependabot) in docker/compose#12548 - bump golang.org/x/sync from 0.10.0 to 0.11.0 by [@​dependabot](https://github.com/dependabot) in docker/compose#12547 - bump gotest.tools/v3 from 3.5.1 to 3.5.2 by [@​dependabot](https://github.com/dependabot) in docker/compose#12549 #### New Contributors - [@​r-bk](https://github.com/r-bk) made their first contribution in docker/compose#12478 - [@​maxproske](https://github.com/maxproske) made their first contribution in docker/compose#12523 **Full Changelog**: docker/compose@v2.32.4...v2.33.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNjYuMSIsInVwZGF0ZWRJblZlciI6IjM5LjE2Ni4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
What I did
Add a warning message listing the env variables and asking for confirmation before publishing a Compose configuration with environment variables
Also added a
--force
/-f
flag to force the publish without asking for confirmationRelated issue
https://docker.atlassian.net/browse/COMP-875
(not mandatory) A picture of a cute animal, if possible in relation to what you did
![image](https://private-user-images.githubusercontent.com/705411/405664876-bf68a709-a10c-4a0c-b0cd-5e350f8ba45d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2OTQ1OTgsIm5iZiI6MTczOTY5NDI5OCwicGF0aCI6Ii83MDU0MTEvNDA1NjY0ODc2LWJmNjhhNzA5LWExMGMtNGEwYy1iMGNkLTVlMzUwZjhiYTQ1ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQwODI0NThaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jZjcwNWQ1MmNiNDNmMzhlNmY2NTA0N2IzM2FiNDk5YTBhODc4YmQ0YzBiOTJiNTM3ZWQ3MTdjMzA3M2I0NjBhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.7-RmUdHJqb8T3uYxhXlpI5jN8N3NIvq4uIXYslDh2Vs)