Skip to content

Preserve integration info during course clone#2588

Open
elenabaurkot wants to merge 1 commit intoinstructure:masterfrom
elenabaurkot:clone-integration-data
Open

Preserve integration info during course clone#2588
elenabaurkot wants to merge 1 commit intoinstructure:masterfrom
elenabaurkot:clone-integration-data

Conversation

@elenabaurkot
Copy link
Copy Markdown

@elenabaurkot elenabaurkot commented Feb 23, 2026

Add opt-in settings to copy integration_id and integration_data on assignments during course copy. External systems rely on these fields to correlate Canvas assignments with third-party records and assignments across courses can share the same IDs.

We reuse intergration_ids and integration_data across courses to be able to track assignment data between courses and semesters. I opened a support ticket and was told integration_data should copy over and that integration_ids were meant to be unique, but since these link to third parties was hopeful people could opt into maintaining over course clone in case the same courses need to link to the same third party data for our case.

Our data team uses DAP (data access platform) to access Canvas data and it only contains integration_id for assignments not integration_data. If we are able to clone only integration_data on course clone, could this potentially be added to DAP?

Test Plan:

  • Create a course with assignments that have integration_id and integration_data set
  • Copy the course with both options enabled
  • Verify cloned assignments retain the values
  • Copy again with options disabled
  • Verify fields are cleared (default behavior)
  • Test via API: POST course copy with settings[copy_integration_ids]=true
  • Verify same behavior as UI

Comment thread app/controllers/content_migrations_controller.rb Outdated
Comment thread app/models/content_migration.rb Outdated
@viszpis
Copy link
Copy Markdown
Contributor

viszpis commented Mar 24, 2026

👋 One more thing, I think this feature needs to be behind a Feature Flag. The flag should be defined in config/feature_flags/00_standard.yml Something like this

course_copy_allow_copying_integration_info:
  applies_to: SiteAdmin
  state: hidden
  display_name: Course Copy: allow copying integration_id and integration_data
  description: Adds opt-in settings to copy integration_id and integration_data on assignments during course copy
  environments:
    ci:
      state: allowed_on
    development:
      state: allowed_on

This should control the import/export flow plus the UI rendering (the checkbox rendering) part.

@elenabaurkot elenabaurkot force-pushed the clone-integration-data branch 2 times, most recently from 14937ce to 30745ba Compare April 6, 2026 14:35
@elenabaurkot elenabaurkot changed the title Preserve integration_ids during course clone Preserve integration info during course clone Apr 6, 2026
Add opt-in setting behind a feature flag to copy
integration_id and integration_data on assignments
during course copy. External systems rely on these
fields to correlate Canvas assignments with
third-party records, and assignments across courses
can share the same IDs.

A single copy_integration_info setting controls
both fields, gated by the
copy_course_integration_info feature flag.

Test Plan:
  - Enable copy_course_integration_info flag
  - Create a course with assignments that have
    integration_id and integration_data set
  - Copy the course with the option enabled
  - Verify cloned assignments retain the values
  - Copy again with option disabled
  - Verify fields are cleared (default behavior)
  - Test via API: POST course copy with
    settings[copy_integration_info]=true
  - Verify same behavior as UI

Made-with: Cursor
@elenabaurkot elenabaurkot force-pushed the clone-integration-data branch from 30745ba to d7ea304 Compare April 6, 2026 14:50
@elenabaurkot elenabaurkot requested a review from viszpis April 6, 2026 17:16
@elenabaurkot
Copy link
Copy Markdown
Author

Thanks for the feedback @viszpis, I've updated the PR with the combined setting, feature flag and environments block. Quick question: once this merges, what's the typical process for enabling a SiteAdmin flag in production? We'd love to be able to use this feature on our instance.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown
Contributor

@spencerolson spencerolson left a comment

Choose a reason for hiding this comment

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

Hi @elenabaurkot this generally looks good, but currently the test suite is failing. Two of the tests you added have failing assertions. Can you fix those please? Thanks!


a_to = @copy_to.assignments.find_by(migration_id: mig_id(@assignment))
expect(a_to.integration_id).to be_nil
expect(a_to.integration_data).to be_nil
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.

this assertion is failing with:

Failure/Error: expect(a_to.integration_data).to be_nil

 expected: nil
      got: {}


a1_to = @copy_to.assignments.find_by(migration_id: mig_id(a1))
expect(a1_to.integration_id).to eq "id-only"
expect(a1_to.integration_data).to be_nil
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.

this assertion is failing with:

Failure/Error: expect(a1_to.integration_data).to be_nil

 expected: nil
      got: {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants