-
Notifications
You must be signed in to change notification settings - Fork 2.4k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changelog for git submodules #7776
Comments
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 |
@rarkins added a requirement. |
I think a diff compare link would definitely be good |
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 :/. |
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. |
A changelog would be very much appreciated here as well! I am using |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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.
The text was updated successfully, but these errors were encountered: