GitLab maintains access to issue forks on git.drupalcode.org. www.drupal.org tries to keep track when web hooks are invoked or push access is requested. But people can leave projects in GitLab, be added as maintainers, etc. Instead of trying to keep our database in sync with GitLab, we can instead have the GraphQL request in issue-fork.js that gets GitLab project information also get the userPermissions.

Issue fork drupalorg-3348875

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

drumm created an issue. See original summary.

fjgarlin made their first commit to this issue’s fork.

fjgarlin’s picture

Status: Active » Needs review

Note that this MR only covers the "isMember" query. I wasn't sure if we'd want to fully remove "drupalorg_issue_fork_maintainers" table here or in a follow-up.

Needs review.

drumm’s picture

Status: Needs review » Needs work

We do use this table to populate the crediting & committing table, so we’ll need to keep it. The number of patches includes the number of pushes to the issue fork.

We should move this to front-end JS to keep response times lower. Any delay in GitLab’s response wouldn’t hold up loading the base issue page.

fjgarlin’s picture

Status: Needs work » Needs review

The checking is now done totally via JavaScript.

I've added a parameter to the "forkInformation" method to allow skipping the check before rendering. If that's the case, we'll show a button to get access by default.

Then, via JS, if the user has access to the fork, the button disappears with a message informing about it.

Same testing information as in #4.

fjgarlin’s picture

Ready for review again at https://fjgarlin-drupal.dev.devdrupal.org/project/config_notify/issues/3...
Feedback in the MR was addressed.

  • drumm committed e23825dd on 7.x-3.x authored by fjgarlin
    Issue #3348875: Check GitLab directly for issue fork push access,...

  • drumm committed a8f05914 on 7.x-3.x
    Issue #3348875: Remove relations
    
drumm’s picture

Deployed, and production does not have the same unexpected GraphQL behavior as dev. So deploy removing that parameter.

  • drumm committed 06cdd62b on 7.x-3.x
    Issue #3348875 by fjgarlin, drumm: Use the REST API for project...
drumm’s picture

Status: Needs review » Fixed

  • drumm committed eca94ebc on 7.x-3.x
    Issue #3348875: Add have-push-access class when you have push access
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.