Skip to content

fix(team-provisioner): skip manual groups in registry group sync - #192

Merged
Alexanderamiri merged 2 commits into
mainfrom
fix/javazone-manual-group
Nov 11, 2026
Merged

Alexanderamiri merged 2 commits into
mainfrom
fix/javazone-manual-group

Conversation

@Alexanderamiri

Copy link
Copy Markdown
Member

Summary

The registry group sync kept adding JavaZone volunteers to javazone@java.no. That is the JavaZone coordination group's list, and only koordineringsgruppa may be in it. A group marked manual: true in the registry's groups.yaml is now kept by hand: nothing syncs into it or plans removals from it.

 provision-groups.py   resolve_memberships
+  manual group → members [] (still sent, so access groups can nest it)
 team-provisioner      handle_sync_groups_and_heros / handle_sync_groups
+  skip manual groups (no Google, Cognito or Identity Center sync)
 reconcile-groups.py   generate_plan
+  no removals planned from manual groups
 provision-groups.py / diff-groups.py
+  no removal warning or membership plan lines for manual groups; plan shows the `manual` flag
 sync-members.py       GROUP_MAP
-  "JavaZone": "javazone"
+  "JavaZone": None   (known choice, no group, no warning)
 sort-members.py       GROUP_PRIORITY drops javazone

Background, from the Google audit log: admin removed ~35 synced users from javazone@java.no on 2026-08-04, and the provisioner re-added ~37 on 2026-10-23, because the registry listed javazone for 36 heroes. Jan Erik cleaned the group by hand on 2026-11-11. It now holds only the nested jz-koordineringsgruppen and three coordinators.

Evidence

  • Before: with the new tests and the old code, python3 -m unittest scripts/tests/test_manual_groups.py terraform/lambda-src/tests/test_team_provisioner_google_group.py → FAILED (failures=6)
    After: python3 -m unittest discover -s scripts/tests → 228 OK, python3 -m unittest discover -s terraform/lambda-src/tests → 267 OK

Review focus

  • handler.py handle_sync_groups_and_heros: manual groups are left out of Step 3 only. They stay in the Step 6 maps, so an access group can still nest them.
  • provision-groups.py: a manual group goes to the Lambda with members: [] and manual: true. An older Lambda therefore only ensures the group exists.

Out of scope: validation skips bot-opened registry PRs; sheet syncs overwrite memberships added by hand; the Apps Script never adds helter. All three predate this PR.

Merge danger

Door: two-way
Blast radius: registry group sync

Applies to prod (single account) via platform CI. Merge this before javaBin/registry fix/javazone-manual-group. Either order is safe against new additions. Revert restores the old behaviour, but the registry no longer lists javazone memberships, so nobody would be re-added.

OpenSpec

spec-free: the repo has no openspec/; this is a bug fix to registry sync behaviour, documented in docs/lambda-functions.md.

🤖 Generated with Claude Code

Alexanderamiri and others added 2 commits November 11, 2026 18:25
javazone@java.no is the JavaZone coordination group's list. The registry
gave `javazone` to ~36 heroes, so every groups/ merge added them to it
(2026-10-23 re-added ~37 users that admin had removed on 2026-08-04).
Only koordineringsgruppa may be in it, and its membership is kept by hand.

A group with `manual: true` in the registry's groups.yaml is now left alone:
- provision-groups.py sends it with no members
- the Lambda skips it in sync_groups_and_heros and sync_groups
- reconcile-groups.py plans no removals from it
- sync-members.py maps the sheet's "JavaZone" choice to no group
- sort-members.py drops the javazone section

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Alexanderamiri
Alexanderamiri requested a review from a team as a code owner November 11, 2026 17:40
@github-actions

Copy link
Copy Markdown

Terraform Plan

🚧 Changes detected — Plan: 0 to add, 1 to change, 0 to destroy.

Plan output
aws_ssm_parameter.atlassian_api_key: Refreshing state... [id=/javabin/platform/atlassian-api-key]
aws_ssm_parameter.atlassian_org_id: Refreshing state... [id=/javabin/platform/atlassian-org-id]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.lambdas.aws_lambda_function.team_provisioner will be updated in-place
  ~ resource "aws_lambda_function" "team_provisioner" {
        id                             = "javabin-team-provisioner"
      ~ last_modified                  = "2026-10-31T14:54:15.000+0000" -> (known after apply)
      ~ source_code_hash               = "tpW4OZM/7/EBE9sKi6c6DAazYfsyHZV2rG/JJUYTTng=" -> "WAVhnqy7u14WWq5Jd9Cm0Gl3MjAcj0FTvfjPWPYUxkc="
        tags                           = {}
        # (21 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "tfplan"

LLM Review

Risk: 🟢 LOW

Plan makes a single in-place update to the Lambda function javabin-team-provisioner, changing only its deployment package (source_code_hash), with no creates or destroys.

  • ✅ [routine] Plan: 0 to add, 1 to change, 0 to destroy. The only change is an in-place update to aws_lambda_function.team_provisioner (module.lambdas), which is a routine code deployment.
  • ✅ [routine] source_code_hash changes from tpW4OZM/... to WAVhnqy7u14... , indicating new function code is being deployed. last_modified is computed by AWS and will update on apply. The function name, role, and configuration are unchanged in this plan.
  • 🔒 [security] No IAM, security group, networking, or public-access changes are present in this plan. The function's execution role and any permissions are not modified. Worth confirming the new package contents came from a reviewed commit, since this plan only shows the hash change.
  • 💰 [cost] No new billable resources are created. No NAT gateways, RDS instances, or load balancers are involved. Cost impact is negligible.
  • 💥 [destruction] No resources are destroyed and no data-loss risk is present. The update is in-place, so the function is not replaced.

@Alexanderamiri
Alexanderamiri merged commit 7b9e998 into main Nov 11, 2026
4 checks passed
@Alexanderamiri
Alexanderamiri deleted the fix/javazone-manual-group branch November 11, 2026 17:41
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.

1 participant