-
-
Notifications
You must be signed in to change notification settings - Fork 376
Use GitLab project ID instead of project name #994
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
1813011
7fa2aeb
84ced7a
3981e72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ import { readFileSync } from "fs" | |
| const nockBack = nock.back | ||
| nockBack.fixtures = __dirname + "/fixtures" | ||
|
|
||
| // We're testing https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/27117 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change dories me a bit, because this link used to work - but now it doesn't?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The repo was moved to gitlab-foss. New MR link: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/27117
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also I think tests should run for both projectId and project path
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the link change should be reverted because https://gitlab.com/456/merge_requests/27117 is 404 this is just a comment, the code can continue use numeric id |
||
| // We're testing https://gitlab.com/456/merge_requests/27117 | ||
| // This has been chosen because it is already merged and publicly available, it's unlikely to change | ||
|
|
||
| /** Returns a fixture. */ | ||
|
|
@@ -27,7 +27,7 @@ describe("GitLab API", () => { | |
|
|
||
| beforeEach(() => { | ||
| api = new GitLabAPI( | ||
| { pullRequestID: "27117", repoSlug: "gitlab-org/gitlab-ce" }, | ||
| { pullRequestID: "27117", repoSlug: "456" }, | ||
| getGitLabAPICredentialsFromEnv({ | ||
| DANGER_GITLAB_HOST: "gitlab.com", | ||
| DANGER_GITLAB_API_TOKEN: "FAKE_DANGER_GITLAB_API_TOKEN", | ||
|
|
@@ -37,22 +37,22 @@ describe("GitLab API", () => { | |
|
|
||
| it("configures host from CI_API_V4_URL", () => { | ||
| api = new GitLabAPI( | ||
| { pullRequestID: "27117", repoSlug: "gitlab-org/gitlab-ce" }, | ||
| { pullRequestID: "27117", repoSlug: "456" }, | ||
| getGitLabAPICredentialsFromEnv({ | ||
| CI_API_V4_URL: "https://testciapiv4url.com/api/v4", | ||
| DANGER_GITLAB_API_TOKEN: "FAKE_DANGER_GITLAB_API_TOKEN", | ||
| }) | ||
| ) | ||
|
|
||
| expect(api.projectURL).toBe("https://testciapiv4url.com/gitlab-org/gitlab-ce") | ||
| expect(api.projectURL).toBe("https://testciapiv4url.com/456") | ||
| }) | ||
|
|
||
| it("projectURL is defined", () => { | ||
| expect(api.projectURL).toBe("https://gitlab.com/gitlab-org/gitlab-ce") | ||
| expect(api.projectURL).toBe("https://gitlab.com/456") | ||
| }) | ||
|
|
||
| it("mergeRequestURL is defined", () => { | ||
| expect(api.mergeRequestURL).toBe("https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/27117") | ||
| expect(api.mergeRequestURL).toBe("https://gitlab.com/456/merge_requests/27117") | ||
| }) | ||
|
|
||
| const sanitizeUserResponse = (nocks: NockDefinition[]): NockDefinition[] => { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.