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

fix: GitHub integration tagging issues #4586

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

novakzaballa
Copy link
Contributor

@novakzaballa novakzaballa commented Sep 4, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request
  • I have added information to docs/ if required so people know about the feature!

Changes

Solve #4585 and #4584

Unit tests updated

@novakzaballa novakzaballa requested a review from a team as a code owner September 4, 2024 14:50
@novakzaballa novakzaballa requested review from matthewelwell and removed request for a team September 4, 2024 14:50
Copy link

vercel bot commented Sep 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Oct 9, 2024 2:19pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Oct 9, 2024 2:19pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Oct 9, 2024 2:19pm

@github-actions github-actions bot added api Issue related to the REST API fix labels Sep 4, 2024
Copy link
Contributor

github-actions bot commented Sep 4, 2024

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-4586 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-4586 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-4586 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-4586 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4586 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-4586 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Sep 4, 2024

Uffizzi Ephemeral Environment deployment-55876

☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/4586

📄 View Application Logs etc.

What is Uffizzi? Learn more!

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.21%. Comparing base (d0a6caf) to head (f92e23e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4586   +/-   ##
=======================================
  Coverage   97.21%   97.21%           
=======================================
  Files        1171     1172    +1     
  Lines       40651    40662   +11     
=======================================
+ Hits        39517    39528   +11     
  Misses       1134     1134           

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

api/integrations/github/github.py Outdated Show resolved Hide resolved
api/integrations/github/github.py Outdated Show resolved Hide resolved
api/integrations/github/github.py Outdated Show resolved Hide resolved
Copy link
Contributor

@zachaysan zachaysan left a comment

Choose a reason for hiding this comment

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

I'm going to be testing this on staging post merge.

@@ -100,8 +116,10 @@ def handle_github_webhook_event(event_type: str, payload: dict[str, Any]) -> Non
handle_installation_deleted(payload)
elif event_type in tag_by_event_type:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is pointless, if event_type isn't in tag_by_event_type then we'll get a KeyError here. I assume based on that, there is no way for event_type to not exist in tag_by_event_type but we should check on this.

If that is the case, I think this can just be changed to (and we can remove one layer of nesting):

elif action in tag_by_event_type[event_type]

Copy link
Contributor

Choose a reason for hiding this comment

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

I checked and it was already filtered in the view code, so the check here is unnecessary. I've updated the relevant code.

@github-actions github-actions bot added fix and removed fix labels Oct 9, 2024
@github-actions github-actions bot added fix and removed fix labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants