Skip to content
Snippets Groups Projects
Commit 1f7b25e5 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix: cache changelog on from/to

parent 562ca438
Branches
No related tags found
No related merge requests found
...@@ -112,8 +112,8 @@ async function getChangeLogJSON({ ...@@ -112,8 +112,8 @@ async function getChangeLogJSON({
} }
const cacheNamespace = 'changelog-github-release'; const cacheNamespace = 'changelog-github-release';
function getCacheKey(version) { function getCacheKey(prev, next) {
return `${repository}:${version}`; return `${repository}:${prev}:${next}`;
} }
const changelogReleases = []; const changelogReleases = [];
...@@ -126,7 +126,7 @@ async function getChangeLogJSON({ ...@@ -126,7 +126,7 @@ async function getChangeLogJSON({
if (include(next.version)) { if (include(next.version)) {
let release = await renovateCache.get( let release = await renovateCache.get(
cacheNamespace, cacheNamespace,
getCacheKey(next.version) getCacheKey(prev.version, next.version)
); );
if (!release) { if (!release) {
release = { release = {
......
...@@ -163,6 +163,7 @@ Object { ...@@ -163,6 +163,7 @@ Object {
Object { Object {
"changes": Array [], "changes": Array [],
"compare": Object {}, "compare": Object {},
"date": undefined,
"releaseNotes": undefined, "releaseNotes": undefined,
"version": "2.5.2", "version": "2.5.2",
}, },
...@@ -189,6 +190,7 @@ Object { ...@@ -189,6 +190,7 @@ Object {
"compare": Object { "compare": Object {
"url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2",
}, },
"date": undefined,
"releaseNotes": Object { "releaseNotes": Object {
"url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2",
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment