Skip to content

Fix condition move: update existing POC instead of creating duplicate#137

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-poc-movement-issue
Draft

Fix condition move: update existing POC instead of creating duplicate#137
Copilot wants to merge 2 commits intomainfrom
copilot/fix-poc-movement-issue

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 27, 2026

When moving a condition from objective A to objective B, Condition.save() was creating a fresh ProjectObjectiveCondition for the new objective while leaving the original POC (with its completion status) orphaned under the old objective. This caused a hidden/displayed POC split where the completion status was never carried over.

Changes

  • framework/models.pyCondition.save() now detects when objective is being changed on an existing condition. Instead of running get_or_create against the new objective, it calls .update(objective=self.objective) on the existing POCs, preserving status in-place:

    old_objective_id = Condition.objects.values_list("objective_id", flat=True).get(pk=self.pk)
    # ...
    ProjectObjectiveCondition.objects.filter(
        condition=self, objective_id=old_objective_id
    ).update(objective=self.objective)
  • framework/test_models.py — Added test_moving_condition_updates_poc_not_creates_duplicate to assert that after moving a condition: exactly one POC exists, it points to the new objective, and its status is preserved.


Manual checks

  • If you changed the Dashboard application or the rock, have you increased the version number in rockcraft.yaml? Remember to use the same version number in README.md.

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] Fix POC movement issue and improve level calculation Fix condition move: update existing POC instead of creating duplicate Mar 28, 2026
Copilot AI requested a review from dwilding March 28, 2026 00:08
@dwilding dwilding assigned dwilding and unassigned dwilding and Copilot Mar 28, 2026
@dwilding dwilding removed their request for review March 28, 2026 00:15
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