Skip to content

Add release-note collector#441

Merged
istio-merge-robot merged 10 commits intoistio:masterfrom
yutongz:release-note
Oct 5, 2017
Merged

Add release-note collector#441
istio-merge-robot merged 10 commits intoistio:masterfrom
yutongz:release-note

Conversation

@yutongz
Copy link
Copy Markdown
Contributor

@yutongz yutongz commented Aug 31, 2017

Release note:

none

It's a binary to collect release-note from repos.

Example command:

$ bazel-bin/toolbox/release_note_collector/release_note_collector --repos istio --previous_release 0.2.2 --current_release 0.2.4 --pr_link

And the release-note would be put into a local file, default is in current directory, named ".releasenote"

The example output is:

$ cat istio.releasenote
istio: istio -- 0.2.4 release note
Previous release version: 0.2.2
* Provide default Mixer configuration for prometheus metrics and stdio logs.  https://github.com/istio/istio/pull/866
* test setup doc update  https://github.com/istio/istio/pull/831
* New config model (breaking change). Migration instructions are [here](https://github.com/istio/istio/blob/release-0.2/samples/CONFIG-MIGRATION.md)  https://github.com/istio/istio/pull/829

@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Aug 31, 2017
@yutongz yutongz requested review from chxchx and sebastienvas August 31, 2017 16:52
for _, repo := range repoList {
log.Printf("Start fetching release note from %s", repo)
queries := createQueryString(repo)
log.Printf("Query: %s", queries)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

queries is a slice and I was not sure what is the behavior of %s in this case. Maybe %v?

order = flag.String("order", "desc", "The sort order if sort parameter is provided. One of asc or desc.")
version = flag.String("version", "", "Release version")
output = flag.String("output", "./", "Path to output file")
startDate = flag.String("start_date", "", "Start date")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You might want to use a ref instead of startDate and endDate. Usually we would ask between 0.1.2 and 0.1.3.

@ldemailly
Copy link
Copy Markdown
Member

that's awesome ! are we going to contribute it back to k8s to replace the bash script from hell ( https://github.com/kubernetes/release/blob/master/relnotes )

subscribe

@sebastienvas
Copy link
Copy Markdown
Contributor

if possible I would do:
bazel-bin/toolbox/release_note_collector/release_note_collector --repos istio,mixer --version v0.2.1 --last_release 0.2.0

@sebastienvas
Copy link
Copy Markdown
Contributor

This does not publish release notes right ?

@yutongz
Copy link
Copy Markdown
Contributor Author

yutongz commented Aug 31, 2017

It will gather all release-note in PR description and put it into a local file.

@yutongz
Copy link
Copy Markdown
Contributor Author

yutongz commented Aug 31, 2017

@sebastienvas
Copy link
Copy Markdown
Contributor

I guess I did not write the right command. I only got 3 notes.

@ldemailly
Copy link
Copy Markdown
Member

use june 1st as the start date so we get all the 0.2.x notes ?

@yutongz
Copy link
Copy Markdown
Contributor Author

yutongz commented Sep 7, 2017

/retest

if err != nil {
return "", err

if ty == "tag" {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Change here because some tags point to a tag while some point to a commit

 GET https://api.github.com/repos/istio/istio/git/refs/tags/0.2.2
{
    "ref": "refs/tags/0.2.2",
    "url": "https://api.github.com/repos/istio/istio/git/refs/tags/0.2.2",
    "object": {
        "sha": "9ac006e070b88dba19ad26048c1010675d77e321",
        "type": "commit",
        "url": "https://api.github.com/repos/istio/istio/git/commits/9ac006e070b88dba19ad26048c1010675d77e321"
    }
}
GET https://api.github.com/repos/istio/mixer/git/refs/tags/0.2.2
{
    "ref": "refs/tags/0.2.2",
    "url": "https://api.github.com/repos/istio/mixer/git/refs/tags/0.2.2",
    "object": {
        "sha": "f146a9ff912337c3d17261140d69801bd6c5789b",
        "type": "tag",
        "url": "https://api.github.com/repos/istio/mixer/git/tags/f146a9ff912337c3d17261140d69801bd6c5789b"
    }
}

@yutongz
Copy link
Copy Markdown
Contributor Author

yutongz commented Sep 25, 2017

PTAL

org = flag.String("user", "istio", "Github owner or org")
repos = flag.String("repos", "", "Github repos, separate using \",\"")
label = flag.String("label", "release-note", "Release-note label")
sort = flag.String("sort", "create", "The sort field. Can be comments, created, or updated.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the default does not match the list. Could you please create const for those.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

type Sort string
const (
  CREATED = Sort("created")
  COMMENTS = Sort("comments")
)

repos = flag.String("repos", "", "Github repos, separate using \",\"")
label = flag.String("label", "release-note", "Release-note label")
sort = flag.String("sort", "create", "The sort field. Can be comments, created, or updated.")
order = flag.String("order", "desc", "The sort order if sort parameter is provided. One of asc or desc.")
Copy link
Copy Markdown
Contributor

@sebastienvas sebastienvas Sep 25, 2017

Choose a reason for hiding this comment

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

type Order string
const (
  DESC = Order("desc")
  ASC = Order("asc")
)


func fetchRelaseNoteFromRepo(repo string, issuesResult *github.IssuesSearchResult) error {
fileName := filepath.Join(*output, repo+releaseNoteSuffix)
f, err := os.OpenFile(fileName, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0600)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you move the file creation outside of this function and just pass an io.Writer instead ? That way we could use one file for all repos.

Copy link
Copy Markdown
Contributor

@sebastienvas sebastienvas left a comment

Choose a reason for hiding this comment

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

Nice. Minor changes. Once we have this committed we should update this page https://github.com/istio/istio/tree/master/release

@yutongz
Copy link
Copy Markdown
Contributor Author

yutongz commented Sep 25, 2017

/retest

@istio-merge-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ldemailly, sebastienvas

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

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@istio-merge-robot
Copy link
Copy Markdown

/test all [submit-queue is verifying that this PR is safe to merge]

@yutongz
Copy link
Copy Markdown
Contributor Author

yutongz commented Oct 4, 2017

/hold

@istio-testing istio-testing added the do-not-merge/hold Block automatic merging of a PR. label Oct 4, 2017
@istio-merge-robot
Copy link
Copy Markdown

/test all [submit-queue is verifying that this PR is safe to merge]

@yutongz yutongz added the do-not-merge Block automatic merging of a PR. label Oct 4, 2017
@ldemailly
Copy link
Copy Markdown
Member

why hold ?

@yutongz yutongz removed do-not-merge Block automatic merging of a PR. cla: human-approved labels Oct 5, 2017
@yutongz
Copy link
Copy Markdown
Contributor Author

yutongz commented Oct 5, 2017

/hold cancel

@istio-testing istio-testing removed the do-not-merge/hold Block automatic merging of a PR. label Oct 5, 2017
@istio-merge-robot
Copy link
Copy Markdown

/test all [submit-queue is verifying that this PR is safe to merge]

@istio-merge-robot
Copy link
Copy Markdown

/lgtm cancel //PR changed after LGTM, removing LGTM. @ldemailly @sebastienvas @yutongz

@yutongz
Copy link
Copy Markdown
Contributor Author

yutongz commented Oct 5, 2017

@ldemailly For fixing linter

@yutongz yutongz added the lgtm label Oct 5, 2017
@istio-merge-robot
Copy link
Copy Markdown

/test all [submit-queue is verifying that this PR is safe to merge]

@istio-merge-robot
Copy link
Copy Markdown

Automatic merge from submit-queue.

@istio-merge-robot istio-merge-robot merged commit 0890c14 into istio:master Oct 5, 2017
@yutongz yutongz deleted the release-note branch October 23, 2017 21:19
rshriram pushed a commit to istio/istio that referenced this pull request Oct 30, 2017
Automatic merge from submit-queue

Add release-note instruction.

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
none
```

Add instruction about how to get collect release-note from PR description.

Should merge after istio/test-infra#441

Former-commit-id: 8c8b8ff
vbatts pushed a commit to vbatts/istio that referenced this pull request Oct 31, 2017
Automatic merge from submit-queue

Add release-note instruction.

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
none
```

Add instruction about how to get collect release-note from PR description.

Should merge after istio/test-infra#441

Former-commit-id: 8c8b8ff
mandarjog pushed a commit to istio/istio that referenced this pull request Nov 2, 2017
Automatic merge from submit-queue

Add release-note instruction.

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
none
```

Add instruction about how to get collect release-note from PR description.

Should merge after istio/test-infra#441

Former-commit-id: 8c8b8ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants