Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update gitlab webhook flow #738

Merged
merged 3 commits into from
Aug 14, 2024
Merged

update gitlab webhook flow #738

merged 3 commits into from
Aug 14, 2024

Conversation

nora-codecov
Copy link
Contributor

Purpose/Motivation

Refine the flow, use webhook_secret if it is set on repo.

Links to relevant tickets

https://github.com/codecov/internal-issues/issues/359

@nora-codecov nora-codecov requested a review from a team August 6, 2024 23:57
@codecov-notifications
Copy link

codecov-notifications bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.16%. Comparing base (dc30d7f) to head (583741b).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@               Coverage Diff                @@
##               main       #738        +/-   ##
================================================
+ Coverage   96.14000   96.16000   +0.02000     
================================================
  Files           814        814                
  Lines         18441      18438         -3     
================================================
  Hits          17731      17731                
+ Misses          710        707         -3     
Flag Coverage Δ
unit 91.91% <100.00%> (+0.01%) ⬆️
unit-latest-uploader 91.91% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nora-codecov nora-codecov force-pushed the nora/366 branch 2 times, most recently from e068893 to 5132710 Compare August 9, 2024 00:40
webhook_handlers/views/gitlab.py Outdated Show resolved Hide resolved
)
message = "User created"
elif event_name in ("project_rename", "project_transfer"):
self._try_initiate_sync_for_owner()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this sync for both owners? do we need it to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so my current hypothesis is this - and i think we were thinking about it wrong before:
A user can only transfer a repo if they have access to the previous location and the new location (both OwnerOrgs).
So doing a sync on the OwnerUser making the transfer request should give us access to both projects (OwnerOrgs), and the sync process must be able to self-correct project/group structure and organization because that's the sync function we use when the user isn't seeing their repos correctly...
So I think this sync (on the OwnerUser) is able to initiate a sync for both OwnerOrgs :)

@nora-codecov nora-codecov force-pushed the nora/366 branch 2 times, most recently from fa46ff9 to 51d8b8c Compare August 9, 2024 21:45
Copy link
Contributor

@matt-codecov matt-codecov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

i think the Owner model also has a bot column and that might give us another way to make sure we successfully sync: if owner_email, path_with_namespace, and old_path_with_namespace all point to Owners without oauth_token set, we can maybe check if they have bot set and use that bot

up to you if you want to look into that in this PR or merge the webhook validation stuff and follow up with that idea separately

@nora-codecov nora-codecov added this pull request to the merge queue Aug 14, 2024
Merged via the queue into main with commit 864b436 Aug 14, 2024
17 of 18 checks passed
@nora-codecov nora-codecov deleted the nora/366 branch August 14, 2024 22:32
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.

2 participants