Skip to content

Conversation

@SoundBot
Copy link
Contributor

@SoundBot SoundBot commented Jun 13, 2025

This addresses this bugzilla ticket: https://bugzilla.mozilla.org/show_bug.cgi?id=1967637:

A typical diff is sorted by filename/path. The diffs that landoscript generates are not. This can plausibly happen in any action that calls diff_contents more than once, but I've certainly seen it in the android_l10n and merge_day actions.

It's an extremely minor thing, but it can be confusing to someone that's not aware that it may happen.

@SoundBot SoundBot requested a review from a team as a code owner June 13, 2025 04:29
Copy link
Contributor

@bhearsum bhearsum left a comment

Choose a reason for hiding this comment

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

Thank you for putting this together! It looks largely fine modulo the few comments below.

Please also update https://github.com/mozilla-releng/scriptworker-scripts/blob/master/landoscript/src/landoscript/actions/android_l10n_import.py and https://github.com/mozilla-releng/scriptworker-scripts/blob/master/landoscript/src/landoscript/actions/version_bump.py to handle this correctly - thank you!

Also, while reviewing this I discovered an issue with the tests. That's being fixed in #1232. Once it lands you'll need to rebase your work on top of it to make sure it is tested properly.

files_to_diff.append(("CLOBBER", orig_clobber_file, new_clobber_file))

if not files_to_diff:
return []
Copy link
Contributor

Choose a reason for hiding this comment

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

This is impossible to hit in reality at the moment (because the CLOBBER file is always in this list), but if we need to return early here, we must return actions, because there may be others added above. (This is different than in android_l10n_sync of course, where there's only one potential action.)

It would probably be cleaner to write this as a if files_to_diff block anyways, and leave the only return statement at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense, I removed that.

@SoundBot
Copy link
Contributor Author

@bhearsum I made these changes, and I'm waiting on #1232

@bhearsum
Copy link
Contributor

@bhearsum I made these changes, and I'm waiting on #1232

Thanks! What I see looks good. I'll hold off on formally approving until that PR merges, and you can rebase on top of it.

@bhearsum
Copy link
Contributor

@bhearsum I made these changes, and I'm waiting on #1232

Thanks! What I see looks good. I'll hold off on formally approving until that PR merges, and you can rebase on top of it.

This has merged now; you should be clear to refresh this work.

@SoundBot
Copy link
Contributor Author

@bhearsum done! Please let me know if anything else is required.

P.S. Do contributions to this repository get an acknowledgment in the FF release notes? I'm talking about community contributions here

continue

path_line = diff.split("\n")[0]
if path_line.startswith("diff --git"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, this misses all but the first file. Due to the way the diffs are split, we lose the diff in the in the subsequent sections.

You can probably fix this by adjusting diffs after the splitting happens.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct! I made changes.

Unrelated to that, I found and fixed some cases where the sorting order was incorrect

Copy link
Contributor

@bhearsum bhearsum left a comment

Choose a reason for hiding this comment

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

Nice work, thank you for working through all of this!

@bhearsum
Copy link
Contributor

P.S. Do contributions to this repository get an acknowledgment in the FF release notes? I'm talking about community contributions here

I'll look into this; I think it's possible for this type of contribution.

@bhearsum bhearsum merged commit 3ec2b54 into mozilla-releng:master Jun 20, 2025
29 checks passed
@SoundBot
Copy link
Contributor Author

@bhearsum thank you for you patience, and I appreciate your guidance!

bhearsum added a commit to bhearsum/scriptworker-scripts that referenced this pull request Jun 20, 2025
This is something I noticed was missing while reviewing the final form of mozilla-releng#1231.
bhearsum added a commit to bhearsum/scriptworker-scripts that referenced this pull request Jun 20, 2025
This is something I noticed was missing while reviewing the final form of mozilla-releng#1231.
bhearsum added a commit that referenced this pull request Jun 20, 2025
This is something I noticed was missing while reviewing the final form of #1231.
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