Skip to content

Commit

Permalink
Merge branch 'main' into feat/27485-bitbucket-task-autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
dandandy authored Aug 21, 2024
2 parents 47f7942 + 0d20f17 commit 3484689
Show file tree
Hide file tree
Showing 24 changed files with 417 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/containerbase/devcontainer:11.11.5
FROM ghcr.io/containerbase/devcontainer:11.11.6
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ jobs:
show-progress: false

- name: docker-config
uses: containerbase/internal-tools@c7fd9c98b79b3ae16e46dd33610327507e33275c # v3.4.6
uses: containerbase/internal-tools@8547f01d73522b44482b8757716e4e1d73cf3a66 # v3.4.7
with:
command: docker-config

Expand Down
3 changes: 2 additions & 1 deletion lib/config/options/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ const options: RenovateOptions[] = [
description:
'Change this value to override the default Renovate sidecar image.',
type: 'string',
default: 'ghcr.io/containerbase/sidecar:11.11.5',
default: 'ghcr.io/containerbase/sidecar:11.11.6',
globalOnly: true,
},
{
Expand Down Expand Up @@ -2906,6 +2906,7 @@ const options: RenovateOptions[] = [
stage: 'repository',
cli: false,
env: false,
mergeable: true,
},
{
name: 'matchMessage',
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/internal/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ const staticGroups = {
commitMessageTopic: 'Node.js',
matchDatasources: ['docker'],
matchPackageNames: [
'/(^/)node$/', // node or ends with "/node, except those below"
'/(?:^|/)node$/', // node or ends with "/node, except those below"
'!calico/node',
'!docker.io/calico/node',
'!kindest/node',
Expand Down
2 changes: 1 addition & 1 deletion lib/data/monorepo.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
"https://github.com/mui/material-ui",
"https://github.com/mui/mui-x"
],
"mdc-react": "material-components/material-components-web-react",
"mdc-react": "https://github.com/material-components/material-components-web-react",
"mdx": "https://github.com/mdx-js/mdx",
"middy-js": "https://github.com/middyjs/middy",
"mikro-orm": "https://github.com/mikro-orm/mikro-orm",
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/datasource/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { DartVersionDatasource } from './dart-version';
import { DenoDatasource } from './deno';
import { DockerDatasource } from './docker';
import { DotnetVersionDatasource } from './dotnet-version';
import { EndoflifeDatePackagesource } from './endoflife-date';
import { EndoflifeDateDatasource } from './endoflife-date';
import { FlutterVersionDatasource } from './flutter-version';
import { GalaxyDatasource } from './galaxy';
import { GalaxyCollectionDatasource } from './galaxy-collection';
Expand Down Expand Up @@ -87,7 +87,7 @@ api.set(DartVersionDatasource.id, new DartVersionDatasource());
api.set(DenoDatasource.id, new DenoDatasource());
api.set(DockerDatasource.id, new DockerDatasource());
api.set(DotnetVersionDatasource.id, new DotnetVersionDatasource());
api.set(EndoflifeDatePackagesource.id, new EndoflifeDatePackagesource());
api.set(EndoflifeDateDatasource.id, new EndoflifeDateDatasource());
api.set(FlutterVersionDatasource.id, new FlutterVersionDatasource());
api.set(GalaxyDatasource.id, new GalaxyDatasource());
api.set(GalaxyCollectionDatasource.id, new GalaxyCollectionDatasource());
Expand Down
6 changes: 3 additions & 3 deletions lib/modules/datasource/endoflife-date/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { Fixtures } from '../../../../test/fixtures';
import * as httpMock from '../../../../test/http-mock';
import { EXTERNAL_HOST_ERROR } from '../../../constants/error-messages';
import { registryUrl } from './common';
import { EndoflifeDatePackagesource } from './index';
import { EndoflifeDateDatasource } from './index';

const datasource = EndoflifeDatePackagesource.id;
const datasource = EndoflifeDateDatasource.id;

// Default package name and mock path to test with
const packageName = 'amazon-eks';
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('modules/datasource/endoflife-date/index', () => {
});

it('returns null without registryUrl', async () => {
const endoflifeDateDatasource = new EndoflifeDatePackagesource();
const endoflifeDateDatasource = new EndoflifeDateDatasource();
const res = await endoflifeDateDatasource.getReleases({
registryUrl: '',
packageName,
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/datasource/endoflife-date/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { GetReleasesConfig, ReleaseResult } from '../types';
import { datasource, registryUrl } from './common';
import { EndoflifeDateVersions } from './schema';

export class EndoflifeDatePackagesource extends Datasource {
export class EndoflifeDateDatasource extends Datasource {
static readonly id = datasource;

override readonly defaultRegistryUrls = [registryUrl];
Expand All @@ -19,7 +19,7 @@ export class EndoflifeDatePackagesource extends Datasource {
'The release timestamp is determined from the `releaseDate` field in the results.';

constructor() {
super(EndoflifeDatePackagesource.id);
super(EndoflifeDateDatasource.id);
}

@cache({
Expand Down
6 changes: 3 additions & 3 deletions lib/modules/datasource/python-version/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cache } from '../../../util/cache/package/decorator';
import { id as versioning } from '../../versioning/python';
import { Datasource } from '../datasource';
import { EndoflifeDatePackagesource } from '../endoflife-date';
import { EndoflifeDateDatasource } from '../endoflife-date';
import { registryUrl as eolRegistryUrl } from '../endoflife-date/common';
import { GithubReleasesDatasource } from '../github-releases';
import type { GetReleasesConfig, ReleaseResult } from '../types';
Expand All @@ -11,12 +11,12 @@ import { PythonRelease } from './schema';
export class PythonVersionDatasource extends Datasource {
static readonly id = datasource;
pythonPrebuildDatasource: GithubReleasesDatasource;
pythonEolDatasource: EndoflifeDatePackagesource;
pythonEolDatasource: EndoflifeDateDatasource;

constructor() {
super(datasource);
this.pythonPrebuildDatasource = new GithubReleasesDatasource();
this.pythonEolDatasource = new EndoflifeDatePackagesource();
this.pythonEolDatasource = new EndoflifeDateDatasource();
}

override readonly customRegistrySupport = false;
Expand Down
2 changes: 2 additions & 0 deletions lib/modules/manager/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import * as gitSubmodules from './git-submodules';
import * as githubActions from './github-actions';
import * as gitlabci from './gitlabci';
import * as gitlabciInclude from './gitlabci-include';
import * as glasskube from './glasskube';
import * as gleam from './gleam';
import * as gomod from './gomod';
import * as gradle from './gradle';
Expand Down Expand Up @@ -138,6 +139,7 @@ api.set('git-submodules', gitSubmodules);
api.set('github-actions', githubActions);
api.set('gitlabci', gitlabci);
api.set('gitlabci-include', gitlabciInclude);
api.set('glasskube', glasskube);
api.set('gleam', gleam);
api.set('gomod', gomod);
api.set('gradle', gradle);
Expand Down
27 changes: 27 additions & 0 deletions lib/modules/manager/glasskube/__fixtures__/package-and-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: packages.glasskube.dev/v1alpha1
kind: PackageRepository
metadata:
annotations:
packages.glasskube.dev/default-repository: "true"
name: glasskube
spec:
url: https://packages.dl.glasskube.dev/packages

---
apiVersion: packages.glasskube.dev/v1alpha1
kind: PackageRepository
metadata:
name: local
spec:
url: http://localhost:9090/packages

---
apiVersion: packages.glasskube.dev/v1alpha1
kind: ClusterPackage
metadata:
name: argo-cd
spec:
packageInfo:
name: argo-cd
repositoryName: glasskube
version: v2.11.7+1
161 changes: 161 additions & 0 deletions lib/modules/manager/glasskube/extract.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
import { codeBlock } from 'common-tags';
import { Fixtures } from '../../../../test/fixtures';
import { fs } from '../../../../test/util';
import { GlobalConfig } from '../../../config/global';
import type { RepoGlobalConfig } from '../../../config/types';
import { GlasskubePackagesDatasource } from '../../datasource/glasskube-packages';
import type { ExtractConfig } from '../types';
import { extractAllPackageFiles, extractPackageFile } from './extract';

const config: ExtractConfig = {};
const adminConfig: RepoGlobalConfig = { localDir: '' };

const packageWithRepoName = codeBlock`
apiVersion: packages.glasskube.dev/v1alpha1
kind: ClusterPackage
metadata:
name: argo-cd
spec:
packageInfo:
name: argo-cd
repositoryName: glasskube
version: v2.11.7+1
`;
const repository = codeBlock`
apiVersion: packages.glasskube.dev/v1alpha1
kind: PackageRepository
metadata:
annotations:
packages.glasskube.dev/default-repository: "true"
name: glasskube
spec:
url: https://packages.dl.glasskube.dev/packages
`;

jest.mock('../../../util/fs');

describe('modules/manager/glasskube/extract', () => {
beforeEach(() => {
GlobalConfig.set(adminConfig);
});

describe('extractPackageFile()', () => {
it('should extract version and registryUrl', () => {
const deps = extractPackageFile(
Fixtures.get('package-and-repo.yaml'),
'package-and-repo.yaml',
);
expect(deps).toEqual({
deps: [
{
depName: 'argo-cd',
currentValue: 'v2.11.7+1',
datasource: GlasskubePackagesDatasource.id,
registryUrls: ['https://packages.dl.glasskube.dev/packages'],
},
],
});
});
});

describe('extractAllPackageFiles()', () => {
it('should return null for empty packageFiles', async () => {
const deps = await extractAllPackageFiles(config, []);
expect(deps).toBeNull();
});

it('should skip package with non-existing repo', async () => {
fs.readLocalFile.mockResolvedValueOnce(packageWithRepoName);
const deps = await extractAllPackageFiles(config, ['package.yaml']);
expect(deps).toEqual([
{
packageFile: 'package.yaml',
deps: [
{
depName: 'argo-cd',
currentValue: 'v2.11.7+1',
datasource: GlasskubePackagesDatasource.id,
skipReason: 'unknown-registry',
},
],
},
]);
});

it('should extract registryUrl from repo in other file', async () => {
fs.readLocalFile.mockResolvedValueOnce(packageWithRepoName);
fs.readLocalFile.mockResolvedValueOnce(repository);
const deps = await extractAllPackageFiles(config, [
'package.yaml',
'repo.yaml',
]);
expect(deps).toEqual([
{
packageFile: 'package.yaml',
deps: [
{
depName: 'argo-cd',
currentValue: 'v2.11.7+1',
datasource: GlasskubePackagesDatasource.id,
registryUrls: ['https://packages.dl.glasskube.dev/packages'],
},
],
},
]);
});

it('should extract registryUrl from default repo in other file', async () => {
fs.readLocalFile.mockResolvedValueOnce(codeBlock`
apiVersion: packages.glasskube.dev/v1alpha1
kind: ClusterPackage
metadata:
name: argo-cd
spec:
packageInfo:
name: argo-cd
version: v2.11.7+1
repositoryName: ""
`);
fs.readLocalFile.mockResolvedValueOnce(codeBlock`
apiVersion: packages.glasskube.dev/v1alpha1
kind: ClusterPackage
metadata:
name: argo-cd
spec:
packageInfo:
name: argo-cd
version: v2.11.7+1
`);
fs.readLocalFile.mockResolvedValueOnce(repository);
const deps = await extractAllPackageFiles(config, [
'package-with-empty-reponame.yaml',
'package-with-missing-reponame.yaml',
'repo.yaml',
]);
expect(deps).toEqual([
{
packageFile: 'package-with-empty-reponame.yaml',
deps: [
{
depName: 'argo-cd',
currentValue: 'v2.11.7+1',
datasource: GlasskubePackagesDatasource.id,
registryUrls: ['https://packages.dl.glasskube.dev/packages'],
},
],
},
{
packageFile: 'package-with-missing-reponame.yaml',
deps: [
{
depName: 'argo-cd',
currentValue: 'v2.11.7+1',
datasource: GlasskubePackagesDatasource.id,
registryUrls: ['https://packages.dl.glasskube.dev/packages'],
},
],
},
]);
});
});
});
Loading

0 comments on commit 3484689

Please sign in to comment.