Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚚 Update weblate merge-resovling script #6163

Merged
merged 4 commits into from
Feb 7, 2025
Merged

🚚 Update weblate merge-resovling script #6163

merged 4 commits into from
Feb 7, 2025

Conversation

boryanagoncharenko
Copy link
Collaborator

Currently, the merge-weblate-resolving-conflicts script executes a doit run _autopr which generates code and then immediately does a git commit. If a new language is added though, some of the newly generated files remain untracked and are not included in the commit. This causes the following merge command to fail:

+ git merge -s recursive -X ours origin/main --no-edit
error: The following untracked working tree files would be overwritten by merge:
	grammars/keywords-jbo.lark
Please move or remove them before you merge.

Evaluate whether adding a git add . before the commit would have unwanted side effects.

@rix0rrr
Copy link
Collaborator

rix0rrr commented Feb 6, 2025

How are we going to test this? Did you run it locally? Can we prevent automatic merge on the next “real” run so that we can confirm it doesn’t add unwanted files?

@boryanagoncharenko
Copy link
Collaborator Author

How are we going to test this? Did you run it locally? Can we prevent automatic merge on the next “real” run so that we can confirm it doesn’t add unwanted files?

Yes, I ran this locally. I think we agree that if we run doit run _autopr _autopr_weblate we can expect that new files will be generated and these are intended to be committed. The question is whether using git add . would also include files that were not intended for the commit. By looking at the doit tasks, I was not able to spot any potentially unwanted files, so I added the command git add . and asked you to evaluate.

Unfortunately, there is not really a way to test this. Next time I have to run the script, I could perform the merge step-by-step and manually check the untracked files. However, this is not an effective testing strategy because I cannot exercise all possible conditions that could lead to untracked files.

One way to reduce the risk is to change the scope to git add grammars. Alternatively, we could close this PR and I will perform the merge manually. After all there is a finite number of languages that can be added.

Copy link
Collaborator

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

I’m okay to give it a go

Copy link
Contributor

mergify bot commented Feb 6, 2025

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

Copy link
Collaborator

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

You know what, I would feel safer if we could scope the add to specific directories, like trnaslations and content

Copy link
Contributor

mergify bot commented Feb 6, 2025

This pull request has been removed from the queue for the following reason: pull request dequeued.

Pull request #6163 has been dequeued. The pull request rule doesn't match anymore. The following conditions don't match anymore:

  • all of:
    • #approved-reviews-by>=1
    • #changes-requested-reviews-by=0
    • check-success=build
    • check-success=cypress
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default_queue]
      • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • any of: [🛡 GitHub branch protection]
        • check-neutral = build
        • check-skipped = build
        • check-success = build
      • any of: [🛡 GitHub branch protection]
        • check-neutral = cypress
        • check-skipped = cypress
        • check-success = cypress
      • any of: [🛡 GitHub branch protection]
        • check-neutral = autopr
        • check-skipped = autopr
        • check-success = autopr

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

Copy link
Contributor

mergify bot commented Feb 7, 2025

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 3d90ae1 into main Feb 7, 2025
11 checks passed
@mergify mergify bot deleted the weblate_merge branch February 7, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants