Skip to content

✨ feat(GHE): add issue sync support - #103424

Merged
GabeVillalobos merged 2 commits into
masterfrom
raj/ghe-feat-par
Jan 14, 2026
Merged

GabeVillalobos merged 2 commits into
masterfrom
raj/ghe-feat-par

Conversation

@iamrajjoshi

@iamrajjoshi iamrajjoshi commented Nov 15, 2025 •

Copy link
Copy Markdown
Collaborator

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 a review from a team November 15, 2025 20:30
@iamrajjoshi
iamrajjoshi requested a review from a team as a code owner 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
@@ -689,3 +695,172 @@ def test_closed(self, mock_get_installation_metadata: MagicMock) -> None:
assert pr.author is not None
assert pr.author.name == "baxterthehacker"
assert pr.merge_commit_sha == "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c"


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

Copy link
Copy Markdown
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

codecov Bot commented Nov 15, 2025 •

Copy link
Copy Markdown

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

getsantry Bot commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

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 +457
IntegrationExternalProject.objects.filter(
organization_integration_id=self.org_integration.id
).delete()

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@GabeVillalobos GabeVillalobos Jan 14, 2026 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 30, 2026

This branch was successfully deployed

1 active deployment
Preview — 088f3bac Deployed Jan 14, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

2 participants