Skip to content

impr(jira): replace the mass overwrite with diff method - #121198

Merged
Christinarlong merged 17 commits into
masterfrom
fix/jira-explicit-mapping-removals
Aug 7, 2026
Merged

Christinarlong merged 17 commits into
masterfrom
fix/jira-explicit-mapping-removals

Conversation

@Christinarlong

@Christinarlong Christinarlong commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Currently the frontend payload comes in like

configData: {
    "123456": {"on_resolve": 123 , "on_unresolve": 456},
    "67890": {"on_resolve": 1 , "on_unresolve": 789} 
     ....
}

These entries each become an IntegrationExternalProject(IEP) row and currently we just replace ALL the current IEP entries for an integration with the latest ones we receive from this config. That means if a project is missing from the config that means we should delete it.

This backend change is to support a new frontend format we want to send instead of

configData: {
    "123456": {"on_resolve": 123 , "on_unresolve": 456},
    "67890":  null
     ....
}

where a project having a null mapping means we should delete its IEP. And if it's omitted means we should do nothing. This makes deletions an explicit action versus if somehow we accidentally sent an empty {} that would delete the entire config.

thoughts

  • could maybe add a feature flag? I think the FF would be more useful on the FE side for the sending of the new format.....

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 4, 2026
@Christinarlong
Christinarlong marked this pull request as ready for review August 4, 2026 20:25
@Christinarlong
Christinarlong requested a review from a team as a code owner August 4, 2026 20:25
@Christinarlong
Christinarlong requested review from a team and GabeVillalobos August 4, 2026 20:30

@ceorourke ceorourke left a comment

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.

lgtm, nice test coverage. I could see putting it behind a flag and logging the omissions if you wanted to be super safe, but since this is an even less destructive change than we have today it seems fine

"mappedColumnLabel": _("Jira Project"),
"formatMessageValue": False,
# For the frontend form to support explicit removals (upsert + tombstone)
"supportsExplicitRemovals": True,

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.

Is this something useful outside of just Jira config mapping updates? Is the plan to widen this to all other project management integrations in the future? They seem susceptible to the same type of IEP deletion issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

potentially, but that would also likely explode the diff on this, so I wanted to keep the scope targeted.

def _validate_project_status_mappings(
project_mappings: Mapping[str, Any],
) -> dict[str, dict[str, str]]:
project_mappings: object,

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.

Can we be more explicit with the type here? Having this as object seems relatively unsafe.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's because the endpoint that calls into this doesn't have a validator (the endpoint is used by all integrations so the input shapes vary wildly). We have guards underneath to assert the type to be a mapping/dict so that's the validation p much

tombstones.add(external_id)
continue

if not isinstance(statuses, Mapping) or not (

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 think this sort of type checking and validation should live in a a validation function, or in a validator at the API level. Separating these would make this more testable and allow us to more easily pass around typed objects in the code than what we're doing now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah this function is behaving like a validator. It's because the endpoint that calls into this is used across integrations there's not an easy way to apply an API level validator/serializer that applies for all integrations.

I think it's okay to have the validator be at the integration level, but I can try and strengthen the typing we return.

Base automatically changed from fix/jira-org-config-mapping-safety to master August 5, 2026 22:47
@Christinarlong
Christinarlong requested a review from a team as a code owner August 5, 2026 22:47
@Christinarlong Christinarlong changed the title impr(jira): replace the mass overwrite with upsert and tombstone system impr(jira): replace the mass overwrite with diff method Aug 5, 2026
@Christinarlong
Christinarlong marked this pull request as draft August 5, 2026 23:06
@Christinarlong
Christinarlong marked this pull request as ready for review August 6, 2026 00:02
@Christinarlong
Christinarlong force-pushed the fix/jira-explicit-mapping-removals branch from da0e580 to ab70b06 Compare August 6, 2026 18:22
@Christinarlong
Christinarlong marked this pull request as draft August 6, 2026 18:50
@Christinarlong
Christinarlong force-pushed the fix/jira-explicit-mapping-removals branch from 8515d1e to da0e580 Compare August 6, 2026 18:53
@Christinarlong
Christinarlong marked this pull request as ready for review August 6, 2026 19:57
@Christinarlong
Christinarlong marked this pull request as draft August 7, 2026 03:25
@Christinarlong
Christinarlong marked this pull request as ready for review August 7, 2026 19:47
@Christinarlong
Christinarlong merged commit 6cae1f6 into master Aug 7, 2026
119 of 121 checks passed
@Christinarlong
Christinarlong deleted the fix/jira-explicit-mapping-removals branch August 7, 2026 20:42

This branch was successfully deployed

1 active deployment
Preview — 49e7edb6 Deployed Aug 7, 2026 by vercel[bot]
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants