Skip to content

[GIT-428] fix: record activity when transferring work items between cycles - #10410

Open
avesh-pathak wants to merge 1 commit into
makeplane:previewfrom
avesh-pathak:fix/GIT-428-cycle-transfer-activity
Open

avesh-pathak wants to merge 1 commit into
makeplane:previewfrom
avesh-pathak:fix/GIT-428-cycle-transfer-activity

Conversation

@avesh-pathak

@avesh-pathak avesh-pathak commented Nov 26, 2026 •

Copy link
Copy Markdown

Description

transfer_cycle_issues sent "created_cycle_issues": [] (a Python list) inside the JSON-serialized current_instance. The activity task runs json.loads() on that value, so it received a list instead of a string and raised TypeError: the JSON object must be str, bytes or bytearray, not list, swallowing the whole activity write. Sending "[]" (a JSON string) matches the other callers (which use serializers.serialize("json", ...)) and lets create_cycle_issue_activity parse it.

Fixes #10383.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Test Scenarios

  • Transfer work items from an ended cycle to a current/upcoming cycle; the work items' activity now records the move.
  • Worker log no longer shows the TypeError.

References

Summary by CodeRabbit

  • Bug Fixes
    • Improved consistency in cycle activity data when issues are transferred between cycles. This helps keep activity records in a predictable format, reducing the chance of inconsistent data appearing in related cycle views.

@CLAassistant

CLAassistant commented Nov 26, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The cycle transfer utility now sets created_cycle_issues to the string "[]" before serializing the activity payload to JSON.

Changes: Cycle transfer activity

Layer / File(s) Summary
Set the activity payload value
apps/api/plane/utils/cycle_transfer_issues.py
The activity payload sets created_cycle_issues to the string "[]" instead of an empty list. JSON serialization therefore emits a string value. This matches the value format expected by the activity task.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • makeplane/plane#10384: Changes cycle activity handling for created_cycle_issues and addresses the same transfer activity failure.
Merge Risk: Minimal · up to 7564d

This fixes missing activity records when work items are transferred between cycles by sending the payload in the format the activity task expects. The change is small and I found no concrete merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: recording work-item activity when work items move between cycles. It also names the fix type and the issue ID. The raw summary shows a one-line change that sends "[]" …
Description check Passed The description follows the repository template. It gives a clear Description that explains the root cause (a Python list where the activity task expects a JSON string) and the fix. It marks the Bug f…
Linked Issues check Passed Issue #10383 requires that moving work items to another cycle records the move in the work item activity. The root cause in the issue is that transfer_cycle_issues in apps/api/plane/utils/cycle_transf…
Out of Scope Changes check Passed The whole-PR summary lists one changed file, apps/api/plane/utils/cycle_transfer_issues.py, with a single-line change to the activity payload value for created_cycle_issues. This file is the transfer …
Full details: Title check

Explanation

The title names the main change: recording work-item activity when work items move between cycles. It also names the fix type and the issue ID. The raw summary shows a one-line change that sends "[]" as a JSON string instead of a list, which fixes the TypeError that blocked the activity write. The title describes this fix at the level of user-visible behavior, so it matches the changeset.

Full details: Description check

Explanation

The description follows the repository template. It gives a clear Description that explains the root cause (a Python list where the activity task expects a JSON string) and the fix. It marks the Bug fix type. It lists test scenarios and links the issue in References. The template's Screenshots section is absent, but it applies only when relevant to the change, so this gap is not critical. The description is mostly complete.

Full details: Linked Issues check

Explanation

Issue #10383 requires that moving work items to another cycle records the move in the work item activity. The root cause in the issue is that transfer_cycle_issues in apps/api/plane/utils/cycle_transfer_issues.py passes created_cycle_issues as a Python list, so create_cycle_issue_activity's json.loads() raises TypeError and issue_activity writes no rows. The whole-PR summary states that this PR changes that value to the string "[]" (+1/-1 in that file), which matches the other callers that send serializers.serialize("json", ...) output. This targets the stated root cause for the transfer path in #10383. Limitation: the repository diff tool was unavailable (changed blobs missing), and the file read at head was truncated before the changed line, so the exact line was confirmed only from the PR summary, not from source at head. The automated tests for this path were not identified in the evidence. The issue's manual reproduction steps are non-coding and were not assessed.

Full details: Out of Scope Changes check

Explanation

The whole-PR summary lists one changed file, apps/api/plane/utils/cycle_transfer_issues.py, with a single-line change to the activity payload value for created_cycle_issues. This file is the transfer path named in #10383, and the change is the fix the issue describes. No unrelated change appears in the supplied evidence. Limitation: the diff tool was unavailable, so the complete changed-file list was taken from the summary and not verified against the git diff.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 07e1841d-25c4-4fdb-9a89-fee7b3188bb7
Commits

Reviewing files that changed from the base of the PR and between 723bb17 and 7564da1.

Files selected for processing: 1

  • apps/api/plane/utils/cycle_transfer_issues.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@makeplane

makeplane Bot commented Nov 26, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

This branch has not been deployed

No deployments
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.

[bug]: Transferring work items to another cycle does not record it in the work items' activity

2 participants