Skip to content

[krel] changelog: Include CHANGELOG/README.md in master commit logic #1143

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

Merged
merged 3 commits into from
Mar 2, 2020

Conversation

justaugustus
Copy link
Member

@justaugustus justaugustus commented Mar 1, 2020

What type of PR is this?
/kind bug

What this PR does / why we need it:

  • anago: Add repo state check after release notes generation
  • [krel] changelog: Include CHANGELOG/README.md in master commit logic

The repo state check allows us to fail during the staging (instead of release) phase when krel changelog does not cleanly commit to the repo.

Signed-off-by: Stephen Augustus [email protected]

Which issue(s) this PR fixes:
Fixes #1144

Does this PR introduce a user-facing change?:

[krel] changelog: Include CHANGELOG/README.md in master commit logic

@k8s-ci-robot
Copy link
Contributor

@justaugustus: Adding label: do-not-merge/blocked-paths because PR changes a protected file.

Reasons for blocking this PR:

[Changes to certain release tools can affect our ability to test, build, and release Kubernetes. This PR must be explicitly approved by SIG Release repo admins.]

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.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/blocked-paths Indicates that a PR should not merge because it touches files in blocked paths. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. area/release-eng Issues or PRs related to the Release Engineering subproject sig/release Categorizes an issue or PR as relevant to SIG Release. labels Mar 1, 2020
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 1, 2020
@justaugustus
Copy link
Member Author

With the current debug statements, we can see that the problem is an uncommitted CHANGELOG/README.md:

================================================================================
PUSH GIT OBJECTS  (11/14)
================================================================================

Checkout master branch to push objects: OK
Pushing --dry-run tags
Pushing v1.19.0-alpha.1 tag: OK
Checkout master branch to push objects: OK

anago::gitlib::push_master(): git status -s
 M CHANGELOG/README.md

anago::gitlib::push_master(): git show
commit 9924ad050e0ff4687db6502e5a5ee3ac9655eb61
Author: Anago GCB <[email protected]>
Date:   Sun Mar 1 01:39:03 2020 +0000

    Add CHANGELOG/CHANGELOG-1.19.md for v1.19.0-alpha.1

diff --git a/CHANGELOG/CHANGELOG-1.19.md b/CHANGELOG/CHANGELOG-1.19.md
new file mode 100644
index 00000000000..d2252ec4158
--- /dev/null
+++ b/CHANGELOG/CHANGELOG-1.19.md
@@ -0,0 +1,142 @@
+<!-- BEGIN MUNGE: GENERATED_TOC -->
+
+- [v1.19.0-alpha.1](#v1190-alpha1)
+  - [Downloads for v1.19.0-alpha.1](#downloads-for-v1190-alpha1)
+    - [Client Binaries](#client-binaries)
+    - [Server Binaries](#server-binaries)
+    - [Node Binaries](#node-binaries)
+  - [Changelog since v1.19.0-alpha.0](#changelog-since-v1190-alpha0)
+  - [Urgent Upgrade Notes](#urgent-upgrade-notes)
+    - [(No, really, you MUST read this before you upgrade)](#no-really-you-must-read-this-before-you-upgrade)
+  - [Changes by Kind](#changes-by-kind)
+    - [Deprecation](#deprecation)
+    - [API Change](#api-change)
+
+<!-- END MUNGE: GENERATED_TOC -->
+
+# v1.19.0-alpha.1
+
+[Documentation](https://docs.k8s.io)
+ <snip>
\ No newline at end of file

anago::gitlib::push_master(): git diff HEAD --name-status
M	CHANGELOG/README.md

So there's an order of operations problem to investigate...

@justaugustus justaugustus added kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. labels Mar 1, 2020
@k8s-ci-robot k8s-ci-robot removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority labels Mar 1, 2020
@justaugustus
Copy link
Member Author

justaugustus commented Mar 1, 2020

So it looks like krel changelog doesn't commit the CHANGELOG/README.md file, which is
why the repo is dirty.

fbf1cd3 adds a repo state check after generating release notes in the staging step. I want to make sure that fails in https://console.cloud.google.com/cloud-build/builds/b97cb6e1-6b7e-4c29-aa34-ebf047a4f43a?project=kubernetes-release-test, before moving on to fixing it in krel changelog.

EDIT: The staging job failed properly when CHANGELOG/README.md was not committed:

level=info msg="Generating TOC"
level=info msg="Changelog \"/workspace/anago-v1.19.0-alpha.0.393+debb1edee1d4d2/src/k8s.io/kubernetes/CHANGELOG/CHANGELOG-1.19.md\" does not exist, creating it"
level=info msg="Writing single HTML to /workspace/anago-v1.19.0-alpha.0.393+debb1edee1d4d2/src/release-notes.html"
level=info msg="Adding CHANGELOG/CHANGELOG-1.19.md to repository"
level=info msg="Committing changes to master branch in repository"
Repo state was dirty after generating release notes. Cannot continue.
'git status -s' output:
 M CHANGELOG/README.md
[2020-Mar-01 20:29:06 UTC] generate_release_notes in 6m30s
FAILED in generate_release_notes.

RELEASE INCOMPLETE! Exiting...

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 1, 2020
@justaugustus
Copy link
Member Author

justaugustus commented Mar 2, 2020

9774126 adds the CHANGELOG/README.md file to the commit when working on master.

master stage was successful:

level=info msg="Generating TOC"
level=info msg="Changelog \"/workspace/anago-v1.19.0-alpha.0.393+debb1edee1d4d2/src/k8s.io/kubernetes/CHANGELOG/CHANGELOG-1.19.md\" does not exist, creating it"
level=info msg="Writing single HTML to /workspace/anago-v1.19.0-alpha.0.393+debb1edee1d4d2/src/release-notes.html"
level=info msg="Adding CHANGELOG/CHANGELOG-1.19.md to repository"
level=info msg="Adding CHANGELOG/README.md to repository"
level=info msg="Committing changes to master branch in repository"
[2020-Mar-01 23:37:06 UTC] generate_release_notes in 14m12s

master release was successful:

anago: DONE main on 42c252ce882d Mon Mar  2 00:06:56 UTC 2020 in 18m48s

release-1.15 stage was successful:

level=info msg="Generating TOC"
level=info msg="Adding new content to changelog file /workspace/anago-v1.15.11-beta.0.18+89a7468341d588/src/k8s.io/kubernetes/CHANGELOG/CHANGELOG-1.15.md "
level=info msg="Writing single HTML to /workspace/anago-v1.15.11-beta.0.18+89a7468341d588/src/release-notes.html"
level=info msg="Adding CHANGELOG/CHANGELOG-1.15.md to repository"
level=info msg="Adding CHANGELOG/README.md to repository"
level=info msg="Committing changes to master branch in repository"
level=info msg="Checking out changelog from master branch"
level=info msg="Committing changes to release branch in repository"
[2020-Mar-02 00:47:46 UTC] generate_release_notes in 15m46s

release-1.15 release was successful:

anago: DONE main on 128d0439240f Mon Mar  2 01:22:32 UTC 2020 in 17m20s

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 2, 2020
@justaugustus justaugustus changed the title [WIP] Debug anago 'gitlib::push_master' [krel] changelog: Include CHANGELOG/README.md in master commit logic Mar 2, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 2, 2020
@justaugustus
Copy link
Member Author

Ready for review:
/assign @saschagrunert @cpanato @hasheddan
cc: @kubernetes/release-engineering

@justaugustus
Copy link
Member Author

justaugustus commented Mar 2, 2020

(I'll drop parts of the debug commit once the 1.15 jobs pass.)
Fixed up git debugs in gitlib::push_master now that 1.15 jobs have passed.

@justaugustus justaugustus removed the do-not-merge/blocked-paths Indicates that a PR should not merge because it touches files in blocked paths. label Mar 2, 2020
Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

/lgtm

Thank you for fixing this bug @justaugustus 🙏

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 2, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justaugustus, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 693165a into kubernetes:master Mar 2, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/release Categorizes an issue or PR as relevant to SIG Release. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

anago fails to rebase during release phase ('gitlib::push_master') on master branch
5 participants