gitstream icon indicating copy to clipboard operation
gitstream copied to clipboard

Cached Group Memberships Cause Incorrect Team Assignments

Open gennadijbgl opened this issue 1 year ago • 2 comments

Describe the bug gitStream.cm is using cached group membership data for assigning labels and reviewers, resulting in incorrect team assignments. Specifically, I was initially assigned to the "Red" team but later moved to a different team. I left the "Red" team few day ago, yet the red_pr automation still triggers for my pull requests even after 24 hours.

For instance, the "Red" team is being assigned to pull requests authored by me, even though my current team membership no longer includes "Red."

To Reproduce

Steps to reproduce the behavior: red_pr: if: - {{ title.Red or author.Red }} run: - action: add-label@v1 args: label: 'Red' - action: add-reviewers@v1 args: reviewers: [{{ team.Red }}]

Expected behavior The automation should fetch and use real-time or recently updated group membership data from GitHub to assign labels and reviewers accurately.

The problem persists even after updating team memberships in GitHub. The gh api /user/teams command confirms that the user is not a member of the "Red" team, but the automation still assigns the team due to cached data in gitStream.cm. There is no apparent way to force-refresh cached group membership data.

gennadijbgl avatar Nov 15 '24 11:11 gennadijbgl

Hi @gennadijbgl, I'm looking into this issue. Can you please share how you define the author variable?

PavelLinearB avatar Nov 18 '24 12:11 PavelLinearB

Hello @PavelLinearB, thank you for looking into we define it the next way: author: red: {{ pr.author_teams | includes(term='Red name') }}

gennadijbgl avatar Nov 18 '24 16:11 gennadijbgl