Skip to content

Default teams behavior is incorrectly ignoring existing cost center assignments #39

Open

Description

@Mike-Nahmias

Here in the documentation for the teams integration it says:

By default, users already in cost centers will be skipped to avoid conflicts.

Here's my config file:

github:
  enterprise: "xxx"
  cost_centers:
    mode: "teams"

logging:
  level: "INFO"
  file: "logs/populate_cost_centers.log"

teams:
  enabled: true
  scope: "enterprise"
  mode: "auto"
  auto_create_cost_centers: true
  remove_users_no_longer_in_teams: true

I didn't notice until after the fact and it wiped some existing cost centers, but when I ran a plan and apply it says this under the Teams Mode Configuration:

Check current cost center: False

When reviewing main.py, I see that it's referencing args.check_current_cost_center.
The arg --check-current-cost-center defaults to false, since the action is store_true.

Activity

  1. Mike-Nahmias commented on Nov 26, 2025

    @Mike-Nahmias
    Author

    Maybe I'm missing something else, I tried another run using this command:
    python main.py --teams-mode --assign-cost-centers --mode apply --yes --verbose --check-current-cost-center

    At the top it says:
    Check current cost center: True

    But then during processing it removes me from my existing cost center and puts me in a different one:

    Warning: 6 19:27:19 [WARNING] src.teams_cost_center_manager: ⚠️  Found 2 users who are members of multiple teams. Each user can only belong to ONE cost center - assignment depends on their current cost center status.
    Warning: 6 19:27:19 [WARNING] src.teams_cost_center_manager:   ⚠️  Mike-Nahmias is in multiple teams [ent:<team-name>, ent:test-github-group] → will be assigned to '[enterprise team] Test Github group'
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions