Skip to content

image push: respect NO_COLOR in aux notes#6957

Merged
thaJeztah merged 1 commit into
docker:masterfrom
WilliamK112:6890-respect-no-color-push
Jun 4, 2026
Merged

image push: respect NO_COLOR in aux notes#6957
thaJeztah merged 1 commit into
docker:masterfrom
WilliamK112:6890-respect-no-color-push

Conversation

@WilliamK112
Copy link
Copy Markdown
Contributor

@WilliamK112 WilliamK112 commented Apr 25, 2026

Summary

  • route docker image push aux-note coloring through tui.Output
  • respect NO_COLOR when rendering the digest mapping note
  • add a regression test covering terminal output with NO_COLOR=1

Why

Fixes docker image push emitting ANSI color codes in aux-note output even when NO_COLOR is set.

Fixes #6890

Testing

  • added regression test: TestRunPushRespectsNoColorForAuxNotes
  • local static check: git diff --check
  • full Go test execution was not available locally in this environment because go is not installed in PATH here; CI should validate compile/test behavior
`docker image push` now respects `NO_COLOR`

@vvoland vvoland added this to the 29.5.0 milestone May 11, 2026
Copy link
Copy Markdown
Collaborator

@vvoland vvoland left a comment

Choose a reason for hiding this comment

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

Thanks, your commit sign-off needs a real name though.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vvoland vvoland modified the milestones: 29.5.0, 29.5.1, 29.5.2 May 14, 2026
@thaJeztah
Copy link
Copy Markdown
Member

Thanks, your commit sign-off needs a real name though.

@WilliamK112 can you fix the sign-off message in the commit to use your real name and e-mail? (Ching Wei Kang) instead of your GitHub handle?

Signed-off-by: WilliamK112 <164879897+WilliamK112@users.noreply.github.com>

Here's some instructions, but let me know if you need more info:


We require all commit messages to have a Signed-off-by line with your name
and e-mail (see "Sign your work"
in the CONTRIBUTING.md in this repository), which looks something like:

Signed-off-by: YourFirstName YourLastName <yourname@example.org>

There is no need to open a new pull request, but to fix this (and make CI pass),
you need to amend the commit(s) in this pull request, and "force push" the amended
commit.

Unfortunately, it's not possible to do so through GitHub's web UI, so this needs
to be done through the git commandline.

You can find some instructions in the output of the DCO check (which can be found
in the "checks" tab on this pull request), as well as in the Moby contributing guide.

Steps to do so "roughly" come down to:

  1. Set your name and e-mail in git's configuration:

    git config --global user.name "YourFirstName YourLastName"
    git config --global user.email "yourname@example.org"

    (Make sure to use your real name (not your GitHub username/handle) and e-mail)

  2. Clone your fork locally

  3. Check out the branch associated with this pull request

  4. Sign-off and amend the existing commit(s)

    git commit --amend --no-edit --signoff

    If your pull request contains multiple commits, either squash the commits (if
    needed) or sign-off each individual commit.

  5. Force push your branch to GitHub (using the --force or --force-with-lease flags) to update the pull request.

Let me know if you need help or more detailed instructions!

Signed-off-by: WilliamK112 <164879897+WilliamK112@users.noreply.github.com>
Signed-off-by: Ching Wei Kang <164879897+WilliamK112@users.noreply.github.com>
@WilliamK112 WilliamK112 force-pushed the 6890-respect-no-color-push branch from c238428 to fe262bc Compare June 3, 2026 19:57
@WilliamK112
Copy link
Copy Markdown
Contributor Author

Updated the PR commit to use my real-name DCO sign-off and force-pushed the branch. The code/test content is unchanged from the earlier passing run; this update is only to clear the sign-off blocker. Thanks for the guidance.

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

I saw someone also opened a PR with a slightly updated test; #7015 - I'll close or rebase that one after this.

Comment on lines +112 to +113
notes = nil
t.Cleanup(func() { notes = nil })
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unrelated to this PR, but we should rewrite the handleAux to get the slice passed in, instead of depending on a package var. For the CLI itself, technically it's not a problem, but the test here shows that we need to manage state now.

I'll have a look at that in a follow-up

notes = nil
t.Cleanup(func() { notes = nil })

err := runPush(context.Background(), cli, pushOptions{remote: "image:tag"})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need to fix (I'll have a look at that in the follow-up); this could use t.Context().

@thaJeztah thaJeztah dismissed vvoland’s stale review June 4, 2026 12:38

DCO was fixed

@thaJeztah thaJeztah merged commit b50c369 into docker:master Jun 4, 2026
95 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Respect NO_COLOR for docker image push

5 participants