Skip to content

Commit 91e9b53

Browse files
committed
Merge branch 'develop' of github.com:smartcontractkit/chainlink into BCF-3361-prom-beholder
2 parents 70bf492 + 87fad88 commit 91e9b53

File tree

3,759 files changed

+268333
-185449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,759 files changed

+268333
-185449
lines changed

.changeset/afraid-houses-learn.md

Lines changed: 5 additions & 0 deletions

.changeset/beige-geckos-explode.md

Lines changed: 5 additions & 0 deletions

.changeset/big-camels-report.md

Lines changed: 5 additions & 0 deletions

.changeset/brave-cooks-itch.md

Lines changed: 5 additions & 0 deletions

.changeset/breezy-kings-clean.md

Lines changed: 5 additions & 0 deletions

.changeset/bright-keys-whisper.md

Lines changed: 5 additions & 0 deletions

.changeset/changelog-generator.js

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/*
2+
* Based off of https://github.com/changesets/changesets/blob/7323704dff6e76f488370db384579b86c95c866f/packages/changelog-github/src/index.ts
3+
*/
4+
5+
const ghInfo = require("@changesets/get-github-info");
6+
7+
const getDependencyReleaseLine = async (changesets, dependenciesUpdated, options) => {
8+
if (dependenciesUpdated.length === 0) return "";
9+
if (!options || !options.repo) {
10+
throw new Error(
11+
'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]'
12+
);
13+
}
14+
15+
const changesetLink = `- Updated dependencies [${(
16+
await Promise.all(
17+
changesets.map(async (cs) => {
18+
if (cs.commit) {
19+
let { links } = await ghInfo.getInfo({
20+
repo: options.repo,
21+
commit: cs.commit,
22+
});
23+
return links.commit;
24+
}
25+
})
26+
)
27+
)
28+
.filter((_) => _)
29+
.join(", ")}]:`;
30+
31+
32+
const updatedDepsList = dependenciesUpdated.map(
33+
(dependency) => ` - ${dependency.name}@${dependency.newVersion}`
34+
);
35+
36+
return [changesetLink, ...updatedDepsList].join("\n");
37+
};
38+
39+
const getReleaseLine = async (changeset, _, options) => {
40+
if (!options || !options.repo) {
41+
throw new Error(
42+
'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]'
43+
);
44+
}
45+
46+
let prFromSummary;
47+
let commitFromSummary;
48+
49+
const replacedChangelog = changeset.summary
50+
.replace(/^\s*(?:pr|pull|pull\s+request):\s*#?(\d+)/im, (_, pr) => {
51+
let num = Number(pr);
52+
if (!isNaN(num)) prFromSummary = num;
53+
return "";
54+
})
55+
.replace(/^\s*commit:\s*([^\s]+)/im, (_, commit) => {
56+
commitFromSummary = commit;
57+
return "";
58+
})
59+
.trim();
60+
61+
const [firstLine, ...futureLines] = replacedChangelog
62+
.split("\n")
63+
.map((l) => l.trimRight());
64+
65+
const links = await (async () => {
66+
if (prFromSummary !== undefined) {
67+
let { links } = await ghInfo.getInfoFromPullRequest({
68+
repo: options.repo,
69+
pull: prFromSummary,
70+
});
71+
if (commitFromSummary) {
72+
const shortCommitId = commitFromSummary.slice(0, 7);
73+
links = {
74+
...links,
75+
commit: `[\`${shortCommitId}\`](https://github.com/${options.repo}/commit/${commitFromSummary})`,
76+
};
77+
}
78+
return links;
79+
}
80+
const commitToFetchFrom = commitFromSummary || changeset.commit;
81+
if (commitToFetchFrom) {
82+
let { links } = await ghInfo.getInfo({
83+
repo: options.repo,
84+
commit: commitToFetchFrom,
85+
});
86+
return links;
87+
}
88+
return {
89+
commit: null,
90+
pull: null,
91+
user: null,
92+
};
93+
})();
94+
95+
const prefix = [
96+
links.pull === null ? "" : ` ${links.pull}`,
97+
links.commit === null ? "" : ` ${links.commit}`,
98+
].join("");
99+
100+
return `\n\n-${prefix ? `${prefix} -` : ""} ${firstLine}\n${futureLines
101+
.map((l) => ` ${l}`)
102+
.join("\n")}`;
103+
};
104+
105+
module.exports = { getReleaseLine, getDependencyReleaseLine };

.changeset/chilled-papayas-jump.md

Lines changed: 5 additions & 0 deletions

.changeset/chilled-papayas-swim.md

Lines changed: 5 additions & 0 deletions

.changeset/chilled-suits-do.md

Lines changed: 5 additions & 0 deletions

0 commit comments

Comments
 (0)