Skip to content

feat: add mergeability checks to summary view#532

Open
jakubbortlik wants to merge 2 commits intoharrisoncramer:developfrom
jakubbortlik:feat/implement-mergeability-checks
Open

feat: add mergeability checks to summary view#532
jakubbortlik wants to merge 2 commits intoharrisoncramer:developfrom
jakubbortlik:feat/implement-mergeability-checks

Conversation

@jakubbortlik
Copy link
Collaborator

Closes #508.

This PR uses Gitlab's GraphQL API to retrieve the mergeability checks from the server and shows them in the Summary view:
image

Users can configure it to:

  • filter out checks by their status (e.g., those that are "INACTIVE")
  • filter out individual checks
  • specify the symbols for individual statuses
  • specify the descriptions for individual checks

Comment on lines 65 to +66
u.merge(info, { refresh = true }),
u.merge(mergeability, { refresh = true }),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it could be more efficient to fetch all the data in one GraphQL request, or only request the mergeability checks if the user includes them in the settings.info.fields.

Ultimately, I'd also like to add to the summary the approvals (#444), which would also be possible with the GraphQL API. Then it would make even more sense to do only one request for the data, or perhaps dynamically create the GraphQL query by only requesting those fields that the user configures.


M.color_details = function(bufnr)
local details_namespace = vim.api.nvim_create_namespace("Details")
for i, v in ipairs(state.settings.info.fields) do
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By introducing the multiline mergeability checks, this iteration over the fields and line indexing would stop working if the mergeability checks were not the last item in the fields table.

I guess, I should fix this in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More detailed meargability tests

1 participant