Skip to content
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

fix(datasource/golang-version): use HEAD instead of master #17205

Merged
merged 4 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions lib/modules/datasource/golang-version/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('modules/datasource/golang-version/index', () => {
it('parses real data', async () => {
httpMock
.scope('https://raw.githubusercontent.com')
.get('/golang/website/master/internal/history/release.go')
.get('/golang/website/HEAD/internal/history/release.go')
.reply(200, golangReleasesContent);
const res = await getPkgReleases({
datasource,
Expand All @@ -36,7 +36,7 @@ describe('modules/datasource/golang-version/index', () => {
it('throws ExternalHostError for invalid release with no versions', async () => {
httpMock
.scope('https://raw.githubusercontent.com')
.get('/golang/website/master/internal/history/release.go')
.get('/golang/website/HEAD/internal/history/release.go')
.reply(200, golangReleasesInvalidContent);
await expect(
getPkgReleases({
Expand All @@ -49,7 +49,7 @@ describe('modules/datasource/golang-version/index', () => {
it('throws ExternalHostError for invalid release with wrong termination', async () => {
httpMock
.scope('https://raw.githubusercontent.com')
.get('/golang/website/master/internal/history/release.go')
.get('/golang/website/HEAD/internal/history/release.go')
.reply(200, golangReleasesInvalidContent2);
await expect(
getPkgReleases({
Expand All @@ -62,7 +62,7 @@ describe('modules/datasource/golang-version/index', () => {
it('throws ExternalHostError for empty result', async () => {
httpMock
.scope('https://raw.githubusercontent.com')
.get('/golang/website/master/internal/history/release.go')
.get('/golang/website/HEAD/internal/history/release.go')
.reply(200, {});
await expect(
getPkgReleases({ datasource, depName: 'golang' })
Expand All @@ -72,7 +72,7 @@ describe('modules/datasource/golang-version/index', () => {
it('throws ExternalHostError for zero releases extracted', async () => {
httpMock
.scope('https://raw.githubusercontent.com')
.get('/golang/website/master/internal/history/release.go')
.get('/golang/website/HEAD/internal/history/release.go')
.reply(200, golangReleasesInvalidContent3);
await expect(
getPkgReleases({ datasource, depName: 'golang' })
Expand All @@ -82,7 +82,7 @@ describe('modules/datasource/golang-version/index', () => {
it('throws ExternalHostError for invalid release semver', async () => {
httpMock
.scope('https://raw.githubusercontent.com')
.get('/golang/website/master/internal/history/release.go')
.get('/golang/website/HEAD/internal/history/release.go')
.reply(200, golangReleasesInvalidContent4);
await expect(
getPkgReleases({ datasource, depName: 'golang' })
Expand All @@ -92,7 +92,7 @@ describe('modules/datasource/golang-version/index', () => {
it('returns null for error 404', async () => {
httpMock
.scope('https://raw.githubusercontent.com')
.get('/golang/website/master/internal/history/release.go')
.get('/golang/website/HEAD/internal/history/release.go')
.reply(404);
expect(
await getPkgReleases({ datasource, depName: 'golang' })
Expand All @@ -102,7 +102,7 @@ describe('modules/datasource/golang-version/index', () => {
it('throws ExternalHostError for invalid release format beginning ', async () => {
httpMock
.scope('https://raw.githubusercontent.com')
.get('/golang/website/master/internal/history/release.go')
.get('/golang/website/HEAD/internal/history/release.go')
.reply(200, golangReleasesInvalidContent5);
await expect(
getPkgReleases({ datasource, depName: 'golang' })
Expand All @@ -112,7 +112,7 @@ describe('modules/datasource/golang-version/index', () => {
it('throws ExternalHostError for invalid release format', async () => {
httpMock
.scope('https://raw.githubusercontent.com')
.get('/golang/website/master/internal/history/release.go')
.get('/golang/website/HEAD/internal/history/release.go')
.reply(200, golangReleasesInvalidContent6);
await expect(
getPkgReleases({ datasource, depName: 'golang' })
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/golang-version/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class GolangVersionDatasource extends Datasource {
};
// TODO: types (#7154)
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
const golangVersionsUrl = `${registryUrl}master/internal/history/release.go`;
const golangVersionsUrl = `${registryUrl}HEAD/internal/history/release.go`;

const response = await this.http.get(golangVersionsUrl);

Expand Down