Repository navigation
Conversation
lkingland
force-pushed
the
pr-3826-rebased
branch
from
October 30, 2026 11:28
6fbcda7 to
27f2985
Compare
Added validation to ensure that the --name flag cannot be provided without the --value flag, and vice versa, in both environment and label commands. This prevents the creation of invalid configurations. Added corresponding unit tests to verify the expected error behavior when these flags are misused.
Updated error handling in the label command to use errors.New instead of fmt.Errorf for consistency in flag validation messages. This change improves clarity and maintains uniformity in error reporting when required flags are missing.
Replaced the buffer writer in the config command setup from ci.NewBufferWriter to github.NewBufferWriter for improved integration. Additionally, introduced a test CI generator factory using fnCmd.NewTestCIGeneratorFactory to enhance testing capabilities for the command. This change aims to streamline the configuration setup process and improve test reliability.
The partial-flag tests only check the error paths. Labels add with both --name and --value returns before those checks, so a regression that rejects the pair would not be caught. Assert Save runs for envs and labels when both flags are set. Share one config command helper for those tests.
config envs add --value=plain saved an entry with no name. ValidateEnvs allows a nil name only for a whole secret or configMap reference, so that func.yaml failed later at build. Validate the new entry before Save. The same rules cover a missing value and an invalid name.
ValidateEnvs says "env entry #0 is missing value field", which means nothing at the CLI and drops the contributor's wording. Check --name without --value first and keep that sentence. ValidateEnvs still rejects a plain value with no name.
lkingland
force-pushed
the
pr-3826-rebased
branch
from
October 30, 2026 14:46
27f2985 to
94f1f1f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fork-internal pre-check of the rebased contributor branch for knative#3826 (author: @Ankitsinghsisodya; their three commits are unchanged apart from the rebase).
Purpose: run the full Actions suite on our fork before any force-push to the contributor's branch. Not for merge. Close this once the upstream push happens.
Tip:
94f1f1f1c48eon current main6bbfab4f2. The patch is the same as27f29856c73c;git range-diffshows an empty interdiff.On top of the rebased contributor commits:
config envs addandconfig labels addwith both--nameand--valuecall Save. The labels checks for a missing flag run only after that both-flags path returns.config envs addvalidates the new entry withValidateEnvsbefore Save. A plain--valuewith no--nameis rejected. A whole{{ secret:NAME }}or{{ configMap:NAME }}value with no name is still saved.--namewithout--valuestill returns the contributor's message:--value is required when --name is provided.