Skip to content

configtxgen: remove the dead -asOrg flag - #5668

Open
amalsaidov wants to merge 1 commit into
hyperledger:mainfrom
amalsaidov:fix/configtxgen-remove-dead-asorg
Open

amalsaidov wants to merge 1 commit into
hyperledger:mainfrom
amalsaidov:fix/configtxgen-remove-dead-asorg

Conversation

@amalsaidov

Copy link
Copy Markdown

Type of change

  • Bug fix

Description

cmd/configtxgen/main.go declares the -asOrg flag but never reads the value.
The only code that used asOrg was doOutputAnchorPeersUpdate, which was removed
together with the -outputAnchorPeersUpdate flag in #4809. Since then -asOrg
has had no effect: passing it (even with an org that does not exist) changes
nothing and produces no error, while the --help output and the command
reference still describe it as a working option. That is misleading for anyone
reading the help or the docs.

This removes the flag, so the tool and its documentation match what it actually
does.

Issue #5602 asks whether maintainers prefer to remove the flag (option a) or keep
it with a deprecation warning (option b). I went with removal because the flag is
already dead and the project removed its only consumer outright in #4809 rather
than deprecating it. Scripts that still pass -asOrg almost always pass
-outputAnchorPeersUpdate next to it, which already fails on current main, so
they are not newly broken by this change. If you would rather keep the flag and
print a deprecation warning instead, I am happy to switch the PR to that.

Additional details

  • Dropped the -asOrg= argument from TestConfigTxFlags in
    cmd/configtxgen/main_test.go. It was only there to exercise the flag; the
    test asserts the output file is written and does not depend on it.
  • Regenerated docs/source/commands/configtxgen.md with scripts/help_docs.sh
    so check-help-docs stays green.
  • Ran locally: go build ./cmd/configtxgen/..., go vet ./cmd/configtxgen/...,
    go test ./cmd/configtxgen/..., gofmt -l, and scripts/help_docs.sh check.
    All pass.

AI-assisted; directed, reviewed and tested by the author.

Related issues

Fixes #5602

The -asOrg flag is declared in cmd/configtxgen/main.go but its value is
never read. The only code that consumed it was doOutputAnchorPeersUpdate,
which went away together with the -outputAnchorPeersUpdate flag in hyperledger#4809,
so -asOrg has had no effect since then. The help text and the command
reference still describe it as if it works, which is misleading.

Remove the flag, drop the -asOrg argument from the TestConfigTxFlags
invocation (it was only there to exercise the flag and the test does not
depend on it), and regenerate docs/source/commands/configtxgen.md so
check-help-docs stays green.

Fixes hyperledger#5602

Signed-off-by: amalsaidov <amalsaidov@users.noreply.github.com>
@amalsaidov
amalsaidov requested review from a team as code owners November 11, 2026 22:40
@mergify

mergify Bot commented Nov 11, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

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.

configtxgen: -asOrg flag is declared but never used

1 participant