Skip to content

Commit

Permalink
[#51] Print a warn message for non-existing users and team during an …
Browse files Browse the repository at this point in the history
…apply rather than raising an error.
  • Loading branch information
netomi committed Jun 2, 2023
1 parent 270ce94 commit b17d915
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

### Changed

- Non-existing users and teams will now trigger a warning message rather a failure during the execution of an `apply` operation. ([#51](https://gitlab.eclipse.org/eclipsefdn/security/otterdog/-/issues/51))
- Prevent printing of credential data when trace mode is enabled. ([#47](https://gitlab.eclipse.org/eclipsefdn/security/otterdog/-/issues/47))
- Switching to module `click` for command line parsing.
- Updated module `playwright` to version 1.33.0.
Expand Down
11 changes: 9 additions & 2 deletions otterdog/providers/github/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,16 @@ def get_actor_ids(self, actor_names: list[str]) -> list[str]:
result = []
for actor in actor_names:
if actor.startswith("/"):
result.append(self.rest_client.get_user_node_id(actor[1:]))
try:
result.append(self.rest_client.get_user_node_id(actor[1:]))
except RuntimeError:
utils.print_warn(f"user '{actor}' does not exist, skipping")

else:
result.append(self.rest_client.get_team_node_id(actor))
try:
result.append(self.rest_client.get_team_node_id(actor))
except RuntimeError:
utils.print_warn(f"team '{actor}' does not exist, skipping")

return result

Expand Down

0 comments on commit b17d915

Please sign in to comment.