Skip to content

SF-3791 Create Settings.xml for resources when missing#3894

Merged
Nateowami merged 1 commit into
masterfrom
fix/SF-3791
May 21, 2026
Merged

SF-3791 Create Settings.xml for resources when missing#3894
Nateowami merged 1 commit into
masterfrom
fix/SF-3791

Conversation

@pmachapman
Copy link
Copy Markdown
Collaborator

@pmachapman pmachapman commented May 19, 2026

This PR ensures that a Settings.xml file is present for a resource when it is installed, and will perform any required resource migrations on sync.


This change is Reviewable


Open with GitKraken

@pmachapman pmachapman added the will require testing PR should not be merged until testers confirm testing is complete label May 19, 2026
@pmachapman pmachapman temporarily deployed to screenshot_diff May 19, 2026 00:27 — with GitHub Actions Inactive
@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.90%. Comparing base (d60ea1f) to head (6bb387b).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3894   +/-   ##
=======================================
  Coverage   80.89%   80.90%           
=======================================
  Files         630      630           
  Lines       40657    40677   +20     
  Branches     6577     6602   +25     
=======================================
+ Hits        32889    32909   +20     
  Misses       6741     6741           
  Partials     1027     1027           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Collaborator

@Nateowami Nateowami left a comment

Choose a reason for hiding this comment

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

@Nateowami made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved.


src/SIL.XForge.Scripture/Services/ParatextService.cs line 2842 at r1 (raw file):

            // Perform migrations, as resources may not have had all migrations run on them
            await MigrateResourceIfRequiredAsync(username, targetParatextId, overrideLanguageId, token);

So, am I inferring correctly that the resource does not contain Settings.xml, but does contain the information (in a different format), and when Paratext unpacks it, it runs a migration?

Copy link
Copy Markdown
Collaborator Author

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

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

@pmachapman made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on Nateowami).


src/SIL.XForge.Scripture/Services/ParatextService.cs line 2842 at r1 (raw file):

Previously, Nateowami wrote…

So, am I inferring correctly that the resource does not contain Settings.xml, but does contain the information (in a different format), and when Paratext unpacks it, it runs a migration?

Yes, that is correct.

Copy link
Copy Markdown
Collaborator

@Nateowami Nateowami left a comment

Choose a reason for hiding this comment

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

@Nateowami reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on pmachapman).


src/SIL.XForge.Scripture/Services/ParatextDataHelper.cs line 160 at r1 (raw file):

        if (fileSystemService.FileExists(oldSsfFile))
        {
            scrText.Settings.RemoveSetting("AllowAdvancedMorphology");

I don't understand how this migration works. The comment says "rename". I would think it would require parsing settings and then saving them in a new format. I also don't know why these settings are being removed (are they allowed in .ssf files but not Settings.xml?). How was this list created?

My best guess:

  1. ParatextData automatically loaded settings from the .ssf file
  2. The settings are now in an internal representation, in the scrText
  3. We're removing some that aren't needed? Not sure why
  4. When we tell it to save, it implicitly saves to Settings.xml
  5. Then we can safely remove the .ssf file

I don't think I could pick this up and reason about it.

Copy link
Copy Markdown
Collaborator Author

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

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

@pmachapman made 1 comment.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on Nateowami).


src/SIL.XForge.Scripture/Services/ParatextDataHelper.cs line 160 at r1 (raw file):

Previously, Nateowami wrote…

I don't understand how this migration works. The comment says "rename". I would think it would require parsing settings and then saving them in a new format. I also don't know why these settings are being removed (are they allowed in .ssf files but not Settings.xml?). How was this list created?

My best guess:

  1. ParatextData automatically loaded settings from the .ssf file
  2. The settings are now in an internal representation, in the scrText
  3. We're removing some that aren't needed? Not sure why
  4. When we tell it to save, it implicitly saves to Settings.xml
  5. Then we can safely remove the .ssf file

I don't think I could pick this up and reason about it.

I have updated the comment to be a bit clearer (hopefully). This code is a direct port of the Paratext migration MigrateProjectSettings.

@pmachapman pmachapman deployed to screenshot_diff May 21, 2026 00:18 — with GitHub Actions Active
Copy link
Copy Markdown
Collaborator

@Nateowami Nateowami left a comment

Choose a reason for hiding this comment

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

:lgtm:

@Nateowami reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on pmachapman).

@Nateowami Nateowami added ready to test testing complete Testing of PR is complete and should no longer hold up merging of the PR and removed will require testing PR should not be merged until testers confirm testing is complete ready to test labels May 21, 2026
@Nateowami Nateowami enabled auto-merge (squash) May 21, 2026 13:58
@Nateowami Nateowami merged commit 12f0d90 into master May 21, 2026
40 checks passed
@Nateowami Nateowami deleted the fix/SF-3791 branch May 21, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing complete Testing of PR is complete and should no longer hold up merging of the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants