firefox-ios
firefox-ios copied to clipboard
Add FXIOS-8408 [v124] Add monorepo migration scripts
:scroll: Tickets
This PR adds scripts that were used to migrate android projects to a monorepo.
We have changed the references to android projects with firefox and focus ios when needed in different scripts and Json files, and also there are some changes related to the release branches names.
Aditionally, we have removed the regexes as they were specifically for android matching between projects.
We have created this document with a description of the scripts, the steps to run it, as well as some issues we had to fix when running this locally in case someone finds the same.
https://docs.google.com/document/d/1WUOjC-TOPV4Xwj0BjKQVScCyzaiHEtLhyXYpkyJ3wbc/edit#heading=h.uvgimr49ls8z
This is an example of the new focus-ios-prep branch automatically created after running the migration script, sync-focus.sh https://github.com/isabelrios/firefox-ios/commits/focus-ios-prep/
:bulb: Description
:pencil: Checklist
You have to check all boxes before merging
- [ ] Filled in the above information (tickets numbers and description of your work)
- [ ] Updated the PR name to follow our PR naming guidelines
- [ ] Wrote unit tests and/or ensured the tests suite is passing
- [ ] When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
- [ ] If needed I updated documentation / comments for complex code and public methods
@JohanLorenzo, please let me ping you to try to answer a few questions we have once we see our focus-ios-prep branch created:
- The branch has a rewritten history including focus repo history, does that look good to you?
- If that's correct, what would be the expected status once this is merged?
There might be more questions, but wanted to leave those for now, thank you for your help! 🙏
I'm wondering if we could use https://github.com/mozilla-releng/staging-firefox-ios or something similar to try the big merge in a different place first rather than our current main branch.. how was that done on android?
I'm wondering if we could use https://github.com/mozilla-releng/staging-firefox-ios or something similar to try the big merge in a different place first rather than our current main branch.. how was that done on android?
We could use it but I'm not sure what you would like to accomplish here. Without using a staging repo, you can visualize what the merge is going to look like at: https://github.com/mozilla-mobile/firefox-ios/compare/main...isabelrios:firefox-ios:focus-ios-prep
Then, I'd recommend creating a PR from there. This way, you'll be able to do the big merge through the regular PR process.
On Android, we used the staging repository because of Taskcluster. We had dozens of checks to perform on a repo that runs all the CI/CD on Taskcluster. I'm not sure if we have similar needs here but I'm happy to discuss this 🙂
- The branch has a rewritten history including focus repo history, does that look good to you?
Looking at the link above:
- the number of commits looks good
- authorship was preserved
- issues and pull requests were correctly identified and got the right links (e.g. https://github.com/isabelrios/firefox-ios/commit/feeaa4314a6997667eb0d1ca50adcf5c2d7c4826)
- files are in the
focus-ios
subdirectory - please make sure this is the name for you all.
It seems the prefix [focus-ios]
wasn't added to each commit message. That's the only issue I see so far.
- If that's correct, what would be the expected status once this is merged?
I'm sorry, I'm not sure I understand. Could you expand on this question?
It seems the prefix [focus-ios] wasn't added to each commit message. That's the only issue I see so far.
Oh right, we will look into this.
If that's correct, what would be the expected status once this is merged?
I'm sorry, I'm not sure I understand. Could you expand on this question?
Just to double check that we would see in main that new commits history, as it would be in the PR...
I forgot to ask about the release branches... I guess we would need one for each one (focus-ios-prep-123 and focus-ios-prep-124)? Note that they have different names as the firefox release branch..
Thank your for your replies, very helpful @JohanLorenzo !
Just to double check that we would see in main that new commits history, as it would be in the PR...
Got it! In this case, you can create a PR from and to your own fork. This way, you can merge the PR and see the final result on your own fork. That's the fastest way to see results 🙂
I forgot to ask about the release branches... I guess we would need one for each one (focus-ios-prep-123 and focus-ios-prep-124)? Note that they have different names as the firefox release branch..
Yup! For each release branch, you will create a PR. You can look at what they're going to look like by doing the same as the main
branch.
We could use it but I'm not sure what you would like to accomplish here. Without using a staging repo, you can visualize what the merge is going to look like at: main...isabelrios:firefox-ios:focus-ios-prep
Looking at the above big diff, just double checking if ascending commit order (e.g, first commit 2015) shown on Github correct which we want, or the reverse?
Thank you all for the explanations about git history. I have one point to ask about the structure of the folder. I pulled in the focus-ios-prep
branch and there's currently the following structure under the focus-ios
folder.
- How are we going to handle the duplicated files/files that are shared between the two projects? We should handle this before the merge of this branch right?
- There's a second
focus-ios
subdirectory inside the firstfocus-ios
directory. I think there should only be one of those (so right under the firstfocus-ios
directory we should have the code related folders). Again, we'll need to handle this change before the big merge right? Thank you!
Thank you all for the explanations about git history. I have one point to ask about the structure of the folder. I pulled in the
focus-ios-prep
branch and there's currently the following structure under thefocus-ios
folder.1. How are we going to handle the duplicated files/files that are shared between the two projects? We should handle this before the merge of this branch right?
I open this jira ticket to work on that: https://mozilla-hub.atlassian.net/browse/FXIOS-8446
For those files that are in both repo we could use the ones in Firefox for now as they are. If I'm not mistaken, the only two actually shared that could break the app / ci in the root directore are:
- bitrise.yml file: we can ignore it in focus since the content of it has been already added to the one in firefox-ios repo. We can only have one for the two apps.
- swiftlint file: we are going to have many issues in focus since we have not been applying same rules there, so my suggestion is to add focus-ios/ path to be ignored and enable rules step by step there or fix the errors in focus repo while we work on these merge scripts. Whatever sounds better for you..
2. There's a second `focus-ios` subdirectory inside the first `focus-ios` directory. I think there should only be one of those (so right under the first `focus-ios` directory we should have the code related folders). Again, we'll need to handle this change before the big merge right?
You are right, all focus repo is moved into a focus-ios folder to do the migration, we don't need that extra level. All files in that folder should be moved to the firefox-ios repo as they are, not insed that folder. I guess the easiest way is to create it as it is and then extract all the files after the merge but I may be mistaken missing something that could be better...
Let's talk about these topics.
One more thing: could create 2 commits for this current PR? The first commit contains the original files in https://github.com/mozilla-mobile/firefox-android/tree/aa1a25c43eba010b7a82a6550a99e41af043adf6/monorepo-migration. The second contains the changes to make it work on focus-ios. That will help reviewing this PR 🙂
Actually, I have created a PR with the original files, then I can rebase and see the diff... https://github.com/mozilla-mobile/firefox-ios/pull/18756 Hope that works
This pull request has conflicts when rebasing. Could you fix it @isabelrios? 🙏
Warnings | |
---|---|
:warning: | Pull Request size seems relatively large. If this Pull Request contains multiple changes, please split each into separate PR will helps faster, easier review. Consider using epic branches for work that would affect main. |
Messages | |
---|---|
:book: | Edited 6 files |
:book: | Created 0 files |
Generated by :no_entry_sign: Danger Swift against 83831a09b784d2edd94d509160271a80757a408a