[#26858] WIP - API for cctray pipeline project
What does this MR do?
Adds an API endpoint of
https://gitlab.com/api/v4/projects/2/pipelines/cc.xml
Returns Project XML according to the cctray standard https://github.com/erikdoe/ccmenu/wiki/Multiple-Project-Summary-Reporting-Standard which works on CCMenu.
Currently only support per project basis and takes the latest pipeline activity.
Are there points in the code the reviewer needs to double check?
-
Do we want to support multiple projects in a single call?
Why was this MR needed?
Adding feature for https://gitlab.com/gitlab-org/gitlab-ce/issues/26858
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
https://gitlab.com/gitlab-org/gitlab-ce/issues/26858
Closes #26858 (moved)
Merge request reports
Activity
added 1 commit
- 2d313439 - [#26858 (moved)] WIP - API for cctray pipeline project
marked the checklist item Changelog entry added, if necessary as completed
marked the checklist item Documentation created/updated as completed
added 1 commit
- 71a4ced3 - [#26858 (moved)] Added changelog, API documentation draft, removed redundant params in api
mentioned in issue #26858 (moved)
added 1 commit
- 1fbc4dbe - [#26858 (moved)] Added changelog, API documentation draft, removed redundant params in api
@tmlee Thanks for the work on this issue.
I don't use this format by myself, but I've just checked CCMenu for Mac and it looks like you can add multiple sources. So, even though the name is "Multiple Project Summary Reporting Standard", exposing this just for a single project in the initial iteration makes sense for me.
Can you help here @shanser @AlexKel @kaystrobach?
- Resolved by TM Lee
- lib/api/v4/pipelines.rb 0 → 100644
2 module V4 3 class Pipelines < Grape::API 4 include PaginationParams 5 6 before { authenticate! } 7 8 params do 9 requires :id, type: String, desc: 'The project ID' 10 end 11 resource :projects, requirements: { id: %r{[^/]+} } do 12 desc 'Get CruiseControl feed for a given project' do 13 success Entities::PipelineBasic 14 end 15 get ':id/pipelines/cc' do 16 authorize! :read_pipeline, user_project 17 env['api.format'] = :xml xml
is the only format recognized for ccmenu standard. Do we want to restrict this to only respond withxml
? The API by default responds with JSON and other formats too (i think).Would adding
requires :format, type: Symbol, values: [:xml], default: :xml
into the params and adding
content_type :xml, 'application/xml'
to the grape endpoint make sense?
@tmlee yes, I think that it makes sense
- Resolved by Adam Niedzielski
- Resolved by TM Lee
- Resolved by TM Lee
- Resolved by TM Lee
- spec/requests/api/v4/pipelines_spec.rb 0 → 100644
24 expect(xml_response["activity"]).to eq 'Sleeping' 25 expect(xml_response["lastBuildStatus"]).to eq 'Unknown' 26 expect(xml_response["lastBuildLabel"]).to eq pipeline.id.to_s 27 expect(xml_response["lastBuildTime"]).to eq '' 28 expect(xml_response["webUrl"]).to eq namespace_project_pipeline_url(project.namespace, 29 project, 30 pipeline) 31 end 32 end 33 34 context 'unauthorized user' do 35 it 'does not return project pipelines' do 36 get api("/projects/#{project.id}/pipelines/cc", non_member) 37 38 expect(response).to have_http_status(404) 39 expect(json_response['message']).to eq '404 Project Not Found' - Resolved by TM Lee
- Resolved by TM Lee
- Resolved by TM Lee
assigned to @tmlee
added 1956 commits
-
1fbc4dbe...133d2bb4 - 1952 commits from branch
gitlab-org:master
- 246ae60f - [#26858 (moved)] WIP - API for cctray pipeline project
- 2043d143 - [#26858 (moved)] Fix rubocop offenses
- 73f0f131 - [#26858 (moved)] Added changelog, API documentation draft, removed redundant params in api
- dfbaaa6c - Place code into pipelines.rb as it is v4
Toggle commit list-
1fbc4dbe...133d2bb4 - 1952 commits from branch
8 8 requires :id, type: String, desc: 'The project ID' 9 9 end 10 10 resource :projects, requirements: { id: %r{[^/]+} } do 11 desc 'Get CruiseControl feed for a given project' do 12 end 13 get ':id/pipelines/cc' do 14 authorize! :read_pipeline, user_project 15 latest_pipeline = user_project.pipelines.last 16 present Ci::CctrayResponseService.new(latest_pipeline.project, @smcgivern pinging you on an ongoing community merge request
Hi,
First of all, thank you for creating a Merge Request to help improve the GitLab product. We are running through old Merge Requests and asking authors to update their Merge Requests
This Merge Request was chosen, as it meets the following criteria:
- Open
- Labelled ~"Community Contribution"
- No activity in the past 6 months
We'd like to ask you to help us out and let us know whether:
- You would like to continue the work here
- You would like us to take on the Merge Request for you
- You would like us to close down the Merge Request
Thanks for your help
/cc @rymai
added auto updated awaiting feedback labels
@ayufan Your team might want to take over this one.
changed milestone to %10.5
Thanks. Assigned that to %10.6.
changed milestone to %10.6
Hi,
First of all, thank you for creating a Merge Request to help improve the GitLab product. We are running through old Merge Requests and asking authors to update their Merge Requests
This Merge Request was chosen, as it meets the following criteria:
- Open
- Labelled ~"Community Contribution"
- No activity in the past 6 months
We'd like to ask you to help us out and let us know whether:
- You would like to continue the work here
- You would like us to take on the Merge Request for you
- You would like us to close down the Merge Request
Thanks for your help
/cc @rymai
Hi @tmlee,
First of all, thank you for creating a Merge Request to help improve the GitLab product. We are running through old Merge Requests and asking authors to update their Merge Requests
This Merge Request was chosen, as it meets the following criteria:
- Open
- Labelled Community contribution
- No activity in the past 2 months (since 2018-07-18T04:30:46.999Z)
We'd like to ask you to help us out and let us know whether:
- You would like to continue the work here
- You would like us to take on the Merge Request for you
- You would like us to close down the Merge Request
Thanks for your help
Improve this comment
@ayufan this is not awaiting feedback from the author anymore, he has requested this MR to be taken over and it was scheduled for 10.6
mentioned in issue #56530 (closed)
changed milestone to %Backlog
mentioned in issue #61091 (closed)
mentioned in issue #64231 (closed)
Hey @tmlee
,GitLab is moving all development for both GitLab Community Edition and Enterprise Edition into a single codebase. The current
gitlab-ce
repository will become a read-only mirror, without any proprietary code. All development is moved to the currentgitlab-ee
repository, which we will rename to justgitlab
in the coming weeks.As part of this migration, issues will be moved to the current
gitlab-ee
project. Merge requests can not be moved, and will be closed and locked instead. We are starting with closing merge requests that have been created at least a year ago, and are not part of the current milestone.If you want to resubmit your merge request, you can do so at https://gitlab.com/gitlab-org/gitlab-ee/merge_requests.
If you have any questions about all of this, please ask them in our dedicated FAQ issue. You can also find more information here:
- https://gitlab.com/gitlab-org/gitlab-ee/issues/13304
- https://about.gitlab.com/2019/08/23/a-single-codebase-for-gitlab-community-and-enterprise-edition/
Frequently Asked Questions
For an up to date list of questions and answers, please take a look at https://gitlab.com/gitlab-org/gitlab-ee/issues/13855
What will we do with the repository names?
https://gitlab.com/gitlab-org/gitlab-ee/ will become https://gitlab.com/gitlab-org/gitlab, and https://gitlab.com/gitlab-org/gitlab-ce will become https://gitlab.com/gitlab-org/gitlab-foss.
Why rename gitlab-ce to gitlab-foss?
Using "gitlab" and "gitlab-ce" would be confusing, so we decided to rename gitlab-ce to gitlab-foss to make the purpose of this FOSS repository more clear
I created a merge requests for CE, and this got closed. What do I need to do?
You will need to create a merge request at https://gitlab.com/gitlab-org/gitlab-ee/. This link will eventually redirect to https://gitlab.com/gitlab-org/gitlab.
How does the licensing work in this new setup?
Everything in the
ee/
directory is proprietary. Everything else is free and open source software. If your merge request does not change anything in theee/
directory, the process of contributing changes is the same as when using the gitlab-ce repository.Will you accept merge requests on the gitlab-ce/gitlab-foss project after it has been renamed?
No. Merge requests submitted to this project will be closed automatically.
Will I still be able to view old issues and merge requests in gitlab-ce/gitlab-foss?
Yes.
How will this affect users of GitLab CE using Omnibus?
No changes will be necessary, as the packages built remain the same.
How will this affect users of GitLab CE that build from source?
Once the project has been renamed, you will need to change your Git remotes to use this new URL. GitLab will take care of redirecting Git operations so there is no hard deadline, but we recommend doing this as soon as the projects have been renamed.
Where can I see a timeline of the remaining steps?
https://gitlab.com/gitlab-org/gitlab-ee/issues/13304
Will community contributions submitted to the new "gitlab" repository be available in the new gitlab-foss repository?
Yes, these changes will be synced to gitlab-foss automatically, several times per day.