Skip to content
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

Incorrect command line help: should include a --branch argument #19

Open
wallrj opened this issue Sep 22, 2020 · 4 comments
Open

Incorrect command line help: should include a --branch argument #19

wallrj opened this issue Sep 22, 2020 · 4 comments
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Comments

@wallrj
Copy link
Member

wallrj commented Sep 22, 2020

./cmrel stage --branch=release-1.0 --release-version=v1.0.2 --help
The stage command will build and stage a cert-manager release to a
Google Cloud Storage bucket. It will create a Google Cloud Build job
which will run a full cross-build and publish the artifacts to the
staging release bucket.

Usage:
  cmrel stage [flags]

Examples:

To stage a release of the 'master' branch to the default staging bucket, run: 

	cmrel stage --git-ref=master

To stage a release of the 'release-0.14' branch to the default staging bucket,
overriding the release version as 'v0.14.0', run:

	cmrel stage --git-ref=release-0.14 --release-version=v0.14.0

Flags:
      --branch string                 The git branch to build the release from. If --git-ref is not specified, the HEAD of this branch will be looked up on GitHub. (default "master")
      --bucket string                 The name of the GCS bucket to stage the release to. (default "cert-manager-release")
      --cloudbuild string             The path to the cloudbuild.yaml file used to perform the cert-manager crossbuild. The default value assumes that this tool is run from the root of the release repository. (default "./gcb/stage/cloudbuild.yaml")
      --git-ref string                The git commit ref of cert-manager that should be staged.
  -h, --help                          help for stage
      --org string                    Name of the GitHub org to fetch cert-manager sources from. (default "jetstack")
      --project string                The GCP project to run the GCB build jobs in. (default "cert-manager-release")
      --published-image-repo string   The docker image repository set when building the release. (default "quay.io/jetstack")
      --release-version string        Optional release version override used to force the version strings used during the release to a specific value.
      --repo string                   Name of the GitHub repo to fetch cert-manager sources from. (default "cert-manager")

Global Flags:
      --debug   If true, output from sub-commands will be directly piped to stderr.
 ./cmrel stage --git-ref=release-1.0 --release-version=v1.0.2
2020/09/22 14:13:51 Root options:
2020/09/22 14:13:51   Debug: false
2020/09/22 14:13:51 Stage options:
2020/09/22 14:13:51   Bucket: "cert-manager-release"
2020/09/22 14:13:51   Org: "jetstack"
2020/09/22 14:13:51   Repo: "cert-manager"
2020/09/22 14:13:51   Branch: "master"
2020/09/22 14:13:51   GitRef: "release-1.0"
2020/09/22 14:13:51   CloudBuildFile: "./gcb/stage/cloudbuild.yaml"
2020/09/22 14:13:51   Project: "cert-manager-release"
2020/09/22 14:13:51   ReleaseVersion: "v1.0.2"
2020/09/22 14:13:51   PublishedImageRepo: "quay.io/jetstack"
2020/09/22 14:13:51 ---
Error: required flag(s) "branch" not set
required flag(s) "branch" not set

@wallrj
Copy link
Member Author

wallrj commented Sep 22, 2020

We found that --branch is marked as a required field, but the code suggests that it should be optional and that --branch is only used when a --git-ref has not been supplied.

We commented out the markRequired line and ran the command as follows:

./cmrel stage --git-ref=release-1.0 --release-version=v1.0.2
2020/09/22 15:02:20 Root options:
2020/09/22 15:02:20   Debug: false
2020/09/22 15:02:20 Stage options:
2020/09/22 15:02:20   Bucket: "cert-manager-release"
2020/09/22 15:02:20   Org: "jetstack"
2020/09/22 15:02:20   Repo: "cert-manager"
2020/09/22 15:02:20   Branch: "master"
2020/09/22 15:02:20   GitRef: "release-1.0"
2020/09/22 15:02:20   CloudBuildFile: "./gcb/stage/cloudbuild.yaml"
2020/09/22 15:02:20   Project: "cert-manager-release"
2020/09/22 15:02:20   ReleaseVersion: "v1.0.2"
2020/09/22 15:02:20   PublishedImageRepo: "quay.io/jetstack"
2020/09/22 15:02:20 ---
2020/09/22 15:02:20 Staging build for jetstack/[email protected]
2020/09/22 15:02:20 DEBUG: Loading cloudbuild.yaml file from "./gcb/stage/cloudbuild.yaml"
2020/09/22 15:02:20 DEBUG: building google cloud build API client
2020/09/22 15:02:20 Submitting GCB build job...
2020/09/22 15:02:21 DEBUG: decoding build operation metadata
2020/09/22 15:02:21 ---
2020/09/22 15:02:21 Submitted build with name: "9f90dcb5-dfee-47f3-a200-943b822a6a97"
2020/09/22 15:02:21   View logs at: https://console.cloud.google.com/cloud-build/builds/9f90dcb5-dfee-47f3-a200-943b822a6a97?project=1021342095237
2020/09/22 15:02:21   Log bucket: gs://1021342095237.cloudbuild-logs.googleusercontent.com
2020/09/22 15:02:21   Once complete, view artifacts at: gs://cert-manager-release/stage/gcb/release/v1.0.2-release-1.0
2020/09/22 15:02:21 ---

But it did not seem to resolve the git-ref release-1.0 to a git commit ID.

We should discuss what the desired behaviour should be.

@wallrj
Copy link
Member Author

wallrj commented Jan 28, 2021

/kind cleanup

@jetstack-bot jetstack-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jan 28, 2021
@wallrj
Copy link
Member Author

wallrj commented Jan 28, 2021

/area deploy

@jetstack-bot
Copy link
Contributor

@wallrj: The label(s) area/deploy cannot be applied, because the repository doesn't have them

In response to this:

/area deploy

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

No branches or pull requests

2 participants