Skip to content

Conversation

@bhearsum
Copy link
Contributor

I believe this broke with #1203, where diff_contents (correctly) stopped always having a newline character at the end of a diff, but callers were not updated to handle it.

Unfortunately, this was masked by a bug in the tests where we split on diff\n instead of \ndiff - resulting in the diffed files not being split correctly.

@bhearsum bhearsum requested a review from a team as a code owner June 13, 2025 15:09
@bhearsum
Copy link
Contributor Author

Copy link
Contributor

@Eijebong Eijebong left a comment

Choose a reason for hiding this comment

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

The patch makes sense, however while reviewing this, I found https://github.com/mozilla-releng/scriptworker-scripts/pull/1232/files#diff-11dcea3f6305f036dc56d6df14db892a02d6291a537bf52c6d5bff6143eb276bR247 which looks wrong, the second condition will always be true, probably should be: if f"-{before}" in diff and f"+{after}" in diff:?

I believe this broke with mozilla-releng#1203, where `diff_contents` (correctly) stopped always having a newline character at the end of a diff, but callers were not updated to handle it. This wasn't a problem in production because AFAICT, the only files we ever touch in landoscript that don't have an EOF newline is `CLOBBER`, which happens (luckily) to be the last file in the `merge_day` diff, and l10n-changesets, which are single file bumps.

Unfortunately, this was masked by a bug in the tests where we split on `diff\n` instead of `\ndiff` - resulting in the diffed files not being split correctly.
@bhearsum
Copy link
Contributor Author

The patch makes sense, however while reviewing this, I found https://github.com/mozilla-releng/scriptworker-scripts/pull/1232/files#diff-11dcea3f6305f036dc56d6df14db892a02d6291a537bf52c6d5bff6143eb276bR247 which looks wrong, the second condition will always be true, probably should be: if f"-{before}" in diff and f"+{after}" in diff:?

Yes, indeed!

@bhearsum bhearsum force-pushed the push-rzyuvqszkpyx branch from e1938df to f9e08d3 Compare June 16, 2025 15:05
@bhearsum bhearsum enabled auto-merge (squash) June 16, 2025 15:06
@bhearsum bhearsum merged commit 8048b14 into mozilla-releng:master Jun 16, 2025
9 checks passed
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