Skip to content
Snippets Groups Projects

[#26858] WIP - API for cctray pipeline project

Closed [#26858] WIP - API for cctray pipeline project
4 unresolved threads
Closed TM Lee requested to merge tmlee/gitlab-ce:26858-gitlab-ci-ccmenu into master
4 unresolved threads

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)

Screen_Shot_2017-04-20_at_2.55.11_PM

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/26858

Closes #26858 (moved)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 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
  • 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'
  • assigned to @tmlee

  • TM Lee added 1956 commits

    added 1956 commits

    Compare with previous version

  • Please add all branches, or even better let the user choose wether all, just master or special branches should be checked :wink:

  • TM Lee added 1 commit

    added 1 commit

    • 15028b11 - Place code into pipelines.rb as it is v4

    Compare with previous version

  • TM Lee added 1 commit

    added 1 commit

    • d158833c - Place code into pipelines.rb as it is v4

    Compare with previous version

  • 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,
    • I would prefer for this to be handled by Grape Entity, and create a virtual Model that would describe a data, instead of constructing that with service like that

    • Please register or sign in to reply
  • @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

  • @ayufan Your team might want to take over this one.

  • Rémy Coutable removed assignee

    removed assignee

  • Kamil Trzciński changed milestone to %10.5

    changed milestone to %10.5

  • Thanks. Assigned that to %10.6.

  • Kamil Trzciński changed milestone 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:

    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)

  • Milestone %10.6 has expired and we're moving it to %Backlog. Please feel free to reschedule to an active milestone.

  • changed milestone to %Backlog

  • mentioned in issue #61091 (closed)

  • mentioned in issue #64231 (closed)

    • Hey @tmlee :wave:,

      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 current gitlab-ee repository, which we will rename to just gitlab 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:

      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 the ee/ 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.

  • 🤖 GitLab Bot 🤖 locked this merge request

    locked this merge request

  • Please register or sign in to reply
    Loading