cert-manager / release

Releasing tooling for the cert-manager project
Apache License 2.0
5 stars 12 forks source link

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

Open wallrj opened 4 years ago

wallrj commented 4 years ago
./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 commented 4 years ago

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/cert-manager@release-1.0
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 commented 3 years ago

/kind cleanup

wallrj commented 3 years ago

/area deploy

jetstack-bot commented 3 years ago

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

In response to [this](https://github.com/cert-manager/release/issues/19#issuecomment-769118345): >/area deploy Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.