Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G ghostflow-director
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 39
    • Issues 39
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Utils
  • ghostflow-director
  • Merge requests
  • !303

Draft: Filter out blocked members in Gitlab projects

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Ben Morgan requested to merge drbenmorgan/ghostflow-director:gitlab-blocked-members into master Jun 14, 2022
  • Overview 6
  • Commits 3
  • Pipelines 2
  • Changes 2

As reported in Issue #92, changes in Gitlab's search functionality since 14.10 can cause Ghostflow project initialization to fail with GitlabServiceError::NoSuchUser errors when:

  • members of the project (direct or from group) are in state blocked or ldap_blocked
  • the ghostflow user does not have admin permissions on the Gitlab instance

Blocked members will still show up in the project/group member lists returned but the API, but their data can no longer be accessed through the user API endpoint via username (User ID does work).

This is a very rough draft MR to sketch a possible solution - the User struct for the gitlab handler has a UserState enum added. That enum is taken pretty much as-is from rust-gitlab, and should be populated accordingly (if I understand serde conversions correctly...) when generating the vector of project/group members.

The conversion of that vector of Users to vector of Memberships has a filter stage added to remove any members whose state is blocked or ldap_blocked. Given that blocked users can't interact with the instance as far as I know, this shouldn't impact other functionality, but this hasn't been tested fully yet - hence the Draft MR to get early feedback and direction (I'm very much a Rust newbie) especially on the testing side.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: gitlab-blocked-members