Skip to content

Commit 81cb510

Browse files
authored
Fix issue automation (#86)
1 parent 0ebb1cf commit 81cb510

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: bug-fix
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: Fix issue automation
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
#description:
19+
20+
# Affected component; a word indicating the component this changeset affects.
21+
component:
22+
23+
# PR number; optional; the PR number that added the changeset.
24+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
25+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
26+
# Please provide it if you are adding a fragment for a different PR.
27+
#pr: 1234
28+
29+
# Issue number; optional; the GitHub issue related to this changeset (either closes or is part of).
30+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
31+
#issue: 1234
32+
33+
# Repository URL; optional; the repository URL related to this changeset and pr and issue numbers.
34+
# If not present is automatically filled by the tooling based on the repository this file has been committed in.
35+
#repository: https://github.com/elastic/elastic-agent-changelog-tool

internal/changelog/builder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ func (b Builder) Build(owner, repo string) error {
117117
b.changelog.Entries[i].LinkedPR = []int{originalPR}
118118
}
119119

120-
if len(entry.LinkedIssue) == 0 && len(entry.LinkedPR) > 0 {
120+
if len(entry.LinkedIssue) == 0 && len(b.changelog.Entries[i].LinkedPR) > 0 {
121121
linkedIssues := []int{}
122122

123-
for _, pr := range entry.LinkedPR {
123+
for _, pr := range b.changelog.Entries[i].LinkedPR {
124124
tempIssues, err := FindIssues(graphqlClient, context.Background(), owner, repo, pr, 50)
125125
if err != nil {
126126
log.Printf("%s: could not find linked issues for pr: %s/pull/%d", entry.File.Name, entry.Repository, entry.LinkedPR)

0 commit comments

Comments
 (0)