-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[GitLabCoverage] subgroup bug #8401
[GitLabCoverage] subgroup bug #8401
Conversation
|
To accomodate GitLab subgroups I need to allow for multiple slashes in the last namedParam (named While writing GitlabCoverageRedirector I ran into an issue: Could I rename the new endpoint to e.g. |
As is often the case, the hardest part is giving things a good name :) This is basically the same issue we hit when we made the same change on the gitlab pipelines build status badge, which is why the old route was A couple of options I considered were |
EDIT:
Hi @chris48s, Should I add a GitLab secret to be able to run GitLab service tests locally? I generated a GitLab secret and added it to my local.yml file but GitLab service tests still don’t pass. Running this locally on my machine currently results in 73 tests failing (both with https://app.circleci.com/pipelines/github/badges/shields/14993/workflows/345e50a3-3953-459f-a62e-bbfdc4773176/jobs/196306 |
This PR is ready for review. |
@@ -3,59 +3,63 @@ import { createServiceTester } from '../tester.js' | |||
export const t = await createServiceTester() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a couple of test cases in here for the redirector: one with a branch and one without. There is a test helper .expectRedirect()
you can use to make sure the correct redirect was issued.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed gitlab-coverage.service
to gitlab-pipeline-coverage.service
to reflect the change in the URL path.
I added gitlab-coverage-redirect.service
(similar as in gitlab-license-redirect.service
). In this file, I placed tests with redirector (branch
+job_name
/gitlab_url
).
Since branch
was a required param in the previous gitlab coverage
route, we cannot add a test without it to test the redirection ;)
This PR is ready for a re-review. |
{ | ||
title: | ||
'Gitlab code coverage (with a subgroup in the name of the project)', | ||
namedParams: { project: 'megabyte-labs/go/cli/bodega' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. One more minor thing. We can drop this example. For all the other GitLab badges (pipeline status, issues, merge requests, releases, etc) they work for repos in nested subgroups but we don't explicitly provide an example in the frontend. In general we try and keep the number of example of different variations in the examples to a minimum if possible. Cheers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, example removed ;)
sorted - cheers 👍 |
oh yeah. Tip: If you put "closes #[issue num]" in the top post, the issue will auto-close when the PR is merged |
related to: #7473
When we pass a subgroup as a part of GitLab's project name, the badge correctly retrieves the pipeline coverage:
http://localhost:8080/gitlab/pipeline-coverage/megabyte-labs/go/cli/bodega
The redirection for the old routes was added (with
branch
):http://localhost:8080/gitlab/coverage/gitlab-org/gitlab-runner/master -> redirects to http://localhost:8080/gitlab/pipeline-coverage/gitlab-org/gitlab-runner.svg?branch=master
with
gitlab_url
:http://localhost:8080/gitlab/pipeline-coverage/GNOME/at-spi2-core?branch=master&gitlab_url=https%3A%2F%2Fgitlab.gnome.org
with
job_name
:http://localhost:8080/gitlab/pipeline-coverage/gitlab-org/gitlab-runner.svg?branch=master&job_name=test%20coverage%20report