What started being an “easy issue to fix” became a mess rapidly due to my inexperience with GitHub, the issue can be seen [here].
Seems that when I tried to fix some linting errors, I rebased it wrongly and created a divergent branch, that’s why every time I tried to rebase again it did not work as expected.
Seems that this can be fixed using
git cherry pick and
git push origin --force but as I was unsure how to go with it, and I rather prefer to test it first in my own repository instead of making the commit history of this issue even worst, I decided to take the long way:
git checkout master
git pull // I’m getting the latest changes
git branch -d fix/248 // Deletes the current local branch
git checkout -b fix/248 // Recreates the local branch again
git push origin fix/248 --force // Overwrites the branch by deleting my previous commits to fix/248 and push the latest code into the same Pull Request (as it has the same name and origin) and ignores the warning with
This is normally not recommended for one reason: You’ll also overwrite other people commits, but as I was the only person working on this branch, then only my commits are the ones being overwritten.
Trying to make some changes to issues like this one [ #15438 ] I kept receiving this error message from the pre-commit linter:
error Line xxx exceeds the maximum line length of 140 max-len
There are multiple times where you’ll need to use more than 140 characters, and the way to avoid this error is by using multi-line statements:
translate( 'a very long string' +
'other parts of the string' +
'even more strings'
- How to create a pull request and how to do it properly?
- Which are the guidelines or conventions to follow that makes everybody’s life easier?
- How to tag and label issues accordingly, so the right people/team can filter through.
- How to set reviewers for your code.
- There’s other commands you’ll need to use besides
- What is CircleCI.
- How to fix conflicts with the base branch. What is
cherry-pick? What about
- What happens after the PR is approved and merged? How to deploy? Shall I do that? What happens if things go south?
- Is my code tested properly?
These are only a couple of new things I’ve learned lately, and has been tremendously beneficial and helpful when trying to reach the objective of closing the knowledge gap between theory and how code is used in “real life”. Also thanks to some experienced colleagues (Like Igor and Andrija) that were happy to help with my newbie questions
I’m pretty happy that some of these Pull Requests had been approved and merged into Calypso, definitely learned a lot in the past weeks trying to contribute to the project and looking forward to keep doing so.
I’ve been interested in testing and automated testing for a while (one of my gigs when I was freelancing was to create automated tests using CasperJS for WordPress sites) but I couldn’t find the time to research on how unit testing is done on WordPress.
I’ve been playing with Hello Dolly and integrating QUnit into the plugin, so is nothing fancy but just some spaghetti code here and there to make it run.
You can find the plugin code in my GitHub here: Repository