github / github/cost-center-automation

Default teams behavior is incorrectly ignoring existing cost center assignments

Open
#39 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
37
Forks
6
PR merge metrics
No merged PRs in 30d

Description

[Here](https://github.com/github/cost-center-automation/blob/main/TEAMS_INTEGRATION.md#warning-user-x-is-in-multiple-teams) 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`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.