Skip to content

Add package folder rename tests and fix struct reference repointing - #2709

Open
retryoos wants to merge 1 commit into
eclipse-4diac:developfrom
retryoos:phase2/package-folder-rename
Open

Add package folder rename tests and fix struct reference repointing#2709
retryoos wants to merge 1 commit into
eclipse-4diac:developfrom
retryoos:phase2/package-folder-rename

Conversation

@retryoos

@retryoos retryoos commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Adds tests for the package folder rename, and fixes a bug they surfaced.

The tests cover that renaming a package folder repackages the contained types and keeps their instances resolvable, with an undo and redo round trip, while a single type file rename only changes the type name.

While writing them I found that the folder rename left struct-typed interface pins pointing at the old package: Producer.OUT, Consumer.DI and Consumer.DO1 stayed mypackage::MyStruct after renaming mypackage to renamedpackage. The rename path computed the struct reference target from the type entry's old package name, unlike the move path. It now derives the target from the new path, so the pins repoint to the new package. Verified in the UI on develop and guarded by the new renamePackageFolder_repointsStructReferencingPins test.

This addresses the two Copilot review comments: the undo/redo round trip is added, and the struct-referencing pins are asserted, which is green now that the underlying bug is fixed.

Closes #2779.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Test Results

  127 files  +1    127 suites  +1   1m 33s ⏱️ +16s
6 210 tests +6  6 209 ✅ +6  1 💤 ±0  0 ❌ ±0 
6 211 runs  +6  6 210 ✅ +6  1 💤 ±0  0 ❌ ±0 

Results for commit 11a3cea. ± Comparison against base commit 122d8f8.

♻️ This comment has been updated with latest results.

@retryoos

retryoos commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@oberlehner ready for review as well when you have some time, this pr adds the package folder rename tests, covering that renaming a folder repackages the contained types and keeps their instances resolvable, while a single file rename only changes the type name

@oberlehner
oberlehner requested review from oberlehner and a balanced review from Copilot August 26, 2026 11:47

Copilot AI 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.

Pull request overview

Adds package-folder rename regression tests and supporting fixture data.

Changes:

  • Adds folder rename test support.
  • Tests package/type renaming and instance resolution.
  • Adds a representative 4diac project fixture.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
RefactoringTestSupport.java Adds folder rename execution support.
PackageRenameTestFixture.java Defines shared fixture constants.
PackageFolderRenameTest.java Adds package and file rename tests.
Producer.fbt Provides a packaged producer type.
MyStruct.dtp Provides a packaged structured type.
Consumer.fbt Provides a packaged consumer type.
ControlBlock.fbt Provides an unaffected external type.
PackageRenameTest.sys Instantiates and connects packaged types.
.project Defines the importable test project.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Adds headless tests for the package folder rename: renaming a package
folder repackages the contained types and keeps their instances
resolvable, with an undo and redo round trip, while a single type file
rename only changes the type name.

Writing the tests surfaced that the folder rename left struct-typed
interface pins pointing at the old package. The rename path computed the
struct reference target from the type entry's old package name, unlike
the move path. It now derives the target from the new path, so the pins
repoint to the new package, and the added test guards it.

Signed-off-by: Dimitrios Kalligaridis <dimitriskalligaridis@gmail.com>
@retryoos
retryoos force-pushed the phase2/package-folder-rename branch from f727fda to 11a3cea Compare August 26, 2026 20:04
@retryoos retryoos changed the title Add tests for the package folder rename Add package folder rename tests and fix struct reference repointing Aug 26, 2026
@oberlehner
oberlehner requested a balanced review from Copilot August 27, 2026 10:32

Copilot AI 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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment on lines +185 to +189
RefactoringTestSupport.undoLastRefactoring();
assertOriginalState();

RefactoringTestSupport.redoLastRefactoring();
assertRenamedState();

@retryoos retryoos Aug 28, 2026

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.

The forward struct-reference repoint is asserted in renamePackageFolder_repointsStructReferencingPins, extending the assertion across the full undo/redo round trip showed that undo reverts the pins correctly, but redo does not re-apply the struct reference to the pins, while the folder, type entry and instance state redo correctly. I want to confirm that redo behavior in the UI before adding round-trip pin coverage or filing it, so for now the round-trip test asserts the state that round-trips correctly and the forward repoint stays in the dedicated test

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI 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.

🟡 Changes recommended

The acknowledged redo path still fails to reapply the renamed struct references, leaving the round trip incomplete.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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.

Package folder rename leaves struct-typed pins pointing at the old package

2 participants