Skip to content

Commit

Permalink
fix: revert changing owners to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
netomi committed Nov 29, 2024
1 parent 6aad612 commit af907ea
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion otterdog/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(
credential_data: dict[str, Any],
):
self._name = name
self._github_id = github_id.lower()
self._github_id = github_id
self._config_repo = config_repo
self._base_template = base_template
self._jsonnet_config = jsonnet_config
Expand Down
3 changes: 0 additions & 3 deletions otterdog/webapp/db/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ async def update_installations_from_config(
async with mongo.odm.session() as session:
# process all projects present in the otterdog config
for github_id in otterdog_config.organization_names:
github_id = github_id.lower()
project_name = otterdog_config.get_project_name(github_id)
if project_name is None:
continue
Expand Down Expand Up @@ -272,7 +271,6 @@ async def get_installation(installation_id: int) -> InstallationModel | None:


async def get_installation_by_github_id(github_id: str) -> InstallationModel | None:
github_id = github_id.lower()
return await mongo.odm.find_one(InstallationModel, InstallationModel.github_id == github_id)


Expand Down Expand Up @@ -344,7 +342,6 @@ async def get_configurations() -> list[ConfigurationModel]:


async def get_configuration_by_github_id(github_id: str) -> ConfigurationModel | None:
github_id = github_id.lower()
return await mongo.odm.find_one(ConfigurationModel, ConfigurationModel.github_id == github_id)


Expand Down
8 changes: 4 additions & 4 deletions otterdog/webapp/webhook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async def on_pull_request_received(data):
return success()

installation_id = event.installation.id
owner = event.organization.login.lower()
owner = event.organization.login
repo_name = event.repository.name

if event.action in ["closed"] and event.pull_request.head.ref.startswith("otterdog/"):
Expand Down Expand Up @@ -198,7 +198,7 @@ async def on_pull_request_review_received(data):
return success()

installation_id = event.installation.id
owner = event.organization.login.lower()
owner = event.organization.login
repo_name = event.repository.name

if not await targets_config_repo(event.repository.name, installation_id):
Expand Down Expand Up @@ -261,7 +261,7 @@ async def on_push_received(data):
return success()

installation_id = event.installation.id
owner = event.organization.login.lower()
owner = event.organization.login
repo_name = event.repository.name

config_repo_touched = await targets_config_repo(repo_name, installation_id)
Expand Down Expand Up @@ -357,7 +357,7 @@ async def on_workflow_job_received(data):
return success()

installation_id = event.installation.id
owner = event.organization.login.lower()
owner = event.organization.login

if event.action in ["queued"]:
logger.debug(f"workflow job queued on runner: {', '.join(event.workflow_job.labels)}")
Expand Down
14 changes: 7 additions & 7 deletions otterdog/webapp/webhook/comment_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def process(self, match: re.Match, event: IssueCommentEvent) -> None:
self.schedule_task(
HelpCommentTask(
unwrap(event.installation).id,
unwrap(event.organization).login.lower(),
unwrap(event.organization).login,
event.repository.name,
event.issue.number,
)
Expand All @@ -74,7 +74,7 @@ def process(self, match: re.Match, event: IssueCommentEvent) -> None:
self.schedule_task(
RetrieveTeamMembershipTask(
unwrap(event.installation).id,
unwrap(event.organization).login.lower(),
unwrap(event.organization).login,
event.repository.name,
event.issue.number,
)
Expand All @@ -91,7 +91,7 @@ def process(self, match: re.Match, event: IssueCommentEvent) -> None:
self.schedule_task(
CheckConfigurationInSyncTask(
unwrap(event.installation).id,
unwrap(event.organization).login.lower(),
unwrap(event.organization).login,
event.repository.name,
event.issue.number,
)
Expand All @@ -108,7 +108,7 @@ def process(self, match: re.Match, event: IssueCommentEvent) -> None:
self.schedule_task(
CompletePullRequestTask(
unwrap(event.installation).id,
unwrap(event.organization).login.lower(),
unwrap(event.organization).login,
event.repository.name,
event.issue.number,
event.sender.login,
Expand All @@ -126,7 +126,7 @@ def process(self, match: re.Match, event: IssueCommentEvent) -> None:
self.schedule_task(
ApplyChangesTask(
unwrap(event.installation).id,
unwrap(event.organization).login.lower(),
unwrap(event.organization).login,
event.repository.name,
event.issue.number,
event.sender.login,
Expand All @@ -144,7 +144,7 @@ def process(self, match: re.Match, event: IssueCommentEvent) -> None:
self.schedule_task(
MergePullRequestTask(
unwrap(event.installation).id,
unwrap(event.organization).login.lower(),
unwrap(event.organization).login,
event.repository.name,
event.issue.number,
event.sender.login,
Expand All @@ -168,7 +168,7 @@ def process(self, match: re.Match, event: IssueCommentEvent) -> None:
self.schedule_task(
ValidatePullRequestTask(
unwrap(event.installation).id,
unwrap(event.organization).login.lower(),
unwrap(event.organization).login,
event.repository.name,
event.issue.number,
log_level,
Expand Down

0 comments on commit af907ea

Please sign in to comment.