changelog for git submodules #24903
Replies: 6 comments 1 reply
-
This is not really a changelog by the usual definition. Sounds like you want a list of commits, which could also apply to other types of updates too. We stopped including them in repos at one point because it can introduce a huge amount of noise in some cases |
Beta Was this translation helpful? Give feedback.
-
@rarkins added a requirement. |
Beta Was this translation helpful? Give feedback.
-
I think a diff compare link would definitely be good |
Beta Was this translation helpful? Give feedback.
-
I tried already to build the link with the template variables, however the link was only given as markdown. Unwrapping markdown and adding parameters was not successfull :/. |
Beta Was this translation helpful? Give feedback.
-
It would be nice to add a comment on the submodule path as markdown with inline code flagged as a diff --git a/renovate b/renovate
index 9e28ef3..70084a6 160000
--- a/renovate
+++ b/renovate
@@ -1 +1 @@
-Subproject commit 9e28ef32752536501af3fbff8a63ccbe5343591c
+Subproject commit 70084a61ef43a8d927b30b99577dd26ae40950d3 We could comment by using the output of Submodule renovate 9e28ef3..70084a6 (rewind):
diff --git a/renovate/lib/modules/datasource/datasource.ts b/renovate/lib/modules/datasource/datasource.ts
index 3d7fa807a..eb9ffa1ce 100644
--- a/renovate/lib/modules/datasource/datasource.ts
+++ b/renovate/lib/modules/datasource/datasource.ts
@@ -19,7 +19,7 @@ export abstract class Datasource implements DatasourceApi {
defaultConfig: Record<string, unknown> | undefined;
- defaultRegistryUrls?: string[] | (() => string[]);
+ defaultRegistryUrls: string[] | undefined;
defaultVersioning: string | undefined;
diff --git a/renovate/lib/modules/datasource/index.spec.ts b/renovate/lib/modules/datasource/index.spec.ts
index ace1cba91..c2054c683 100644
--- a/renovate/lib/modules/datasource/index.spec.ts
+++ b/renovate/lib/modules/datasource/index.spec.ts
@@ -43,47 +43,6 @@ class DummyDatasource extends Datasource {
}
}
-class DummyDatasource2 extends Datasource {
- override defaultRegistryUrls = function () {
- return ['https://reg1.com'];
- };
-
- constructor(private registriesMock: RegistriesMock = defaultRegistriesMock) {
- super(datasource);
- }
-
- override getReleases({
- registryUrl,
- }: GetReleasesConfig): Promise<ReleaseResult | null> {
- const fn = this.registriesMock[registryUrl];
- if (typeof fn === 'function') {
- return Promise.resolve(fn());
- }
- return Promise.resolve(fn ?? null);
- }
-}
-
-class DummyDatasource3 extends Datasource {
- override customRegistrySupport = false;
- override defaultRegistryUrls = function () {
- return ['https://reg1.com'];
- };
-
- constructor(private registriesMock: RegistriesMock = defaultRegistriesMock) {
- super(datasource);
- }
-
- override getReleases({
- registryUrl,
- }: GetReleasesConfig): Promise<ReleaseResult | null> {
- const fn = this.registriesMock[registryUrl];
- if (typeof fn === 'function') {
- return Promise.resolve(fn());
- }
- return Promise.resolve(fn ?? null);
- }
-}
-
jest.mock('./metadata-manual', () => ({
manualChangelogUrls: {
dummy: {
@@ -253,30 +212,6 @@ describe('modules/datasource/index', () => {
expect(res).toMatchObject({ releases: [{ version: '0.0.1' }] });
});
- it('defaultRegistryUrls function works', async () => {
- datasources.set(datasource, new DummyDatasource2());
- const res = await getPkgReleases({
- datasource,
- depName,
- });
- expect(res).toMatchObject({
- releases: [{ version: '1.2.3' }],
- registryUrl: 'https://reg1.com',
- });
- });
-
- it('defaultRegistryUrls function with customRegistrySupport works', async () => {
- datasources.set(datasource, new DummyDatasource3());
- const res = await getPkgReleases({
- datasource,
- depName,
- });
- expect(res).toMatchObject({
- releases: [{ version: '1.2.3' }],
- registryUrl: 'https://reg1.com',
- });
- });
-
it('applies extractVersion', async () => {
const registries: RegistriesMock = {
'https://reg1.com': {
diff --git a/renovate/lib/modules/datasource/index.ts b/renovate/lib/modules/datasource/index.ts
index ece88626a..b55b1c2e1 100644
--- a/renovate/lib/modules/datasource/index.ts
+++ b/renovate/lib/modules/datasource/index.ts
@@ -209,9 +209,7 @@ function resolveRegistryUrls(
'Custom registries are not allowed for this datasource and will be ignored'
);
}
- return is.function_(datasource.defaultRegistryUrls)
- ? datasource.defaultRegistryUrls()
- : datasource.defaultRegistryUrls ?? [];
+ return datasource.defaultRegistryUrls ?? [];
}
const customUrls = registryUrls?.filter(Boolean);
let resolvedUrls: string[] = [];
@@ -220,9 +218,6 @@ function resolveRegistryUrls(
} else if (is.nonEmptyArray(defaultRegistryUrls)) {
resolvedUrls = [...defaultRegistryUrls];
resolvedUrls.concat(additionalRegistryUrls ?? []);
- } else if (is.function_(datasource.defaultRegistryUrls)) {
- resolvedUrls = [...datasource.defaultRegistryUrls()];
- resolvedUrls.concat(additionalRegistryUrls ?? []);
} else if (is.nonEmptyArray(datasource.defaultRegistryUrls)) {
resolvedUrls = [...datasource.defaultRegistryUrls];
resolvedUrls.concat(additionalRegistryUrls ?? []);
diff --git a/renovate/lib/modules/datasource/types.ts b/renovate/lib/modules/datasource/types.ts
index 867c8829f..be5e106ec 100644
--- a/renovate/lib/modules/datasource/types.ts
+++ b/renovate/lib/modules/datasource/types.ts
@@ -76,7 +76,7 @@ export interface DatasourceApi extends ModuleApi {
id: string;
getDigest?(config: DigestConfig, newValue?: string): Promise<string | null>;
getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null>;
- defaultRegistryUrls?: string[] | (() => string[]);
+ defaultRegistryUrls?: string[];
defaultVersioning?: string;
defaultConfig?: Record<string, unknown>; This would give reviewers of the pull request the context of the change between the two revisions. We could also do the commit log with Submodule renovate 9e28ef3..70084a6 (rewind):
< refactor: redefine defaultRegistryUrls (#15856) This is all from a very toy repository I made locally, added this project as a submodule, and rewound it by a single commit. |
Beta Was this translation helpful? Give feedback.
-
A changelog would be very much appreciated here as well! I am using |
Beta Was this translation helpful? Give feedback.
-
What would you like Renovate to be able to do?
I would like to have insights into updates offered by a new submodule version besides "hash is different" ;)
Did you already have any implementation ideas?
yes
git diff --submodule=diff
.Requirements:
Have a summary of what has changed either as commit list or as diff.
Beta Was this translation helpful? Give feedback.
All reactions