Skip to content

Conversation

@iamrajjoshi
Copy link
Collaborator

@iamrajjoshi iamrajjoshi commented Nov 15, 2025

Added support for the Issue Sync Integration for Github Enterprise. Its mostly just using the issue sync spec.

Please review the first commit because it is the only commit with the changes, the rest is just boiler plate tests.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@iamrajjoshi iamrajjoshi self-assigned this Nov 15, 2025
@iamrajjoshi iamrajjoshi requested review from a team as code owners November 15, 2025 20:30
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 15, 2025
assert pr.merge_commit_sha == "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c"


@with_feature("organizations:integrations-github-project-management")
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Fix Enterprise feature flag mismatch in webhook tests.

The webhook test class uses the wrong feature flag "organizations:integrations-github-project-management" (for GitHub) instead of "organizations:integrations-github_enterprise-project-management" (for GitHub Enterprise). This causes tests to pass under conditions that wouldn't exist in production. The should_sync_assignee_inbound function checks for the github_enterprise specific flag, and the GitHubIssueSyncSpec.check_feature_flag method also constructs the feature flag name from the provider, which would be github_enterprise. The test decorator needs to match the actual feature flag that gates the functionality.

Fix in Cursor Fix in Web

@codecov
Copy link

codecov bot commented Nov 15, 2025

Codecov Report

❌ Patch coverage is 72.30769% with 18 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ntry/integrations/github_enterprise/integration.py 71.66% 17 Missing ⚠️
src/sentry/integrations/utils/sync.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##           raj/gh-feat-par/issue-sync-spec   #103424      +/-   ##
====================================================================
- Coverage                            80.61%    80.61%   -0.01%     
====================================================================
  Files                                 9414      9414              
  Lines                               403736    403796      +60     
  Branches                             25662     25662              
====================================================================
+ Hits                                325466    325510      +44     
- Misses                               77801     77817      +16     
  Partials                               469       469              

@getsantry
Copy link
Contributor

getsantry bot commented Dec 11, 2025

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

"""
config: list[dict[str, Any]] = []

if features.has("organizations:integrations-github-project-management", self.organization):

This comment was marked as outdated.

Comment on lines +455 to +462
IntegrationExternalProject.objects.filter(
organization_integration_id=self.org_integration.id
).delete()
Copy link
Member

Choose a reason for hiding this comment

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

I just realized, shouldn't this be in a transaction along with the create stuff a few lines down? We'd want these project updates to be atomic whenever possible. Same with the GitHub update_configuration work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

true, i think this is something that exists with jira and azure as well.

i can put up a followup PR for this.

Base automatically changed from raj/gh-feat-par/issue-sync-spec to master January 7, 2026 21:26
@iamrajjoshi iamrajjoshi added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Jan 11, 2026
external_id=repo_id,
resolved_status=statuses["on_resolve"],
unresolved_status=statuses["on_unresolve"],
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Config update deletes data before validation completes

Medium Severity

The update_organization_config method deletes all existing IntegrationExternalProject records at lines 460-462 before validating each new project's status values in the loop at lines 467-477. If validation fails for any project (e.g., invalid status value), the original configuration is already deleted but the new configuration is incomplete. This causes data loss—users lose their original settings and don't get their intended new configuration.

Fix in Cursor Fix in Web

Copy link
Member

@GabeVillalobos GabeVillalobos Jan 14, 2026

Choose a reason for hiding this comment

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

Already flagged this in the manual review, but good catch. @iamrajjoshi, please make sure to post this please.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep follow pr for this.

@GabeVillalobos GabeVillalobos merged commit 6b9ce9c into master Jan 14, 2026
66 checks passed
@GabeVillalobos GabeVillalobos deleted the raj/ghe-feat-par branch January 14, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants