-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix #20381 : Added Github Action for developer Onboarding leads #20683
Conversation
Assigning @U8NWXD for the first pass review of this PR. Thanks! |
@seanlip This is the comment that needs to watch out from previous opened Pr #20382 (comment) |
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HardikGoyal2003 Re #20382 (comment), fair enough, but then should we give this step a name to explain what it actually does, just like the other steps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @U8NWXD Please can you explain, I looked at the code but couldn't get it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't leave this comment, but if you're asking how to give the step a name, take a look at the immediately preceding step:
- name: Checkout repository
uses: actions/checkout@v4
Checkout repository
is the name. If you're confused by the YAML syntax, here's the spec: https://yaml.org/spec/1.2.2/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@U8NWXD No, I think I was unclear, what I wanted to ask is what - uses: ./.github/actions/merge
this does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the code for reference:
oppia/.github/actions/merge/action.yml
Lines 1 to 26 in 0e6d986
name: 'Merge Source Branch into Base Branch' | |
description: 'Merge the PR source branch into its base branch, leaving the merge commit checked-out' | |
runs: | |
using: 'composite' | |
steps: | |
- id: merge | |
name: Merge | |
run: | | |
if [[ ${{ github.event_name}} != "pull_request" ]] | |
then | |
echo "Skipping merge because not triggered by a PR event." | |
exit 0 | |
fi | |
echo "Base Repository: ${{ github.repository }}" | |
echo "Base Branch: ${{ github.base_ref }}" | |
echo "Head Repository: ${{ github.event.pull_request.head.repo.full_name }}" | |
echo "Head Branch: $GITHUB_HEAD_REF" | |
git config --global user.email "mergeAction@example.com" | |
git config --global user.name "Oppia Merge Base Branch GitHub Action" | |
git remote add source "https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git" | |
git remote add base "https://github.com/${{ github.repository }}.git" | |
git fetch source $GITHUB_HEAD_REF | |
git fetch base ${{ github.base_ref }} | |
git checkout base/${{ github.base_ref }} | |
git merge source/$GITHUB_HEAD_REF | |
shell: bash |
The branch that the PR was opened against (usually develop
) is called the base
. The branch that has the changes in the PR (in this case, onboarding
) is called the source
. This action checks out the base branch and merges in the source. This mimics what would happen when the PR is merged. It then leaves the merge commit checked-out so that all the tests run against this simulated post-merge code.
We added this step so that if we fixed flaky tests in develop, PRs would automatically incorporate those fixes as soon as the tests were rerun. Otherwise, PR authors would have to manually merge with develop and rerun all the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HardikGoyal2003 -- ah, thanks. Do you know where the linter error originates and which PR introduced that check? I ask because this might be the first workflow we've written that doesn't actually need it, so we might want to consider adding it as an exception to that lint check rather than putting code in here that doesn't make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks @HardikGoyal2003. I think, let's leave a comment in this step to explain it's not actually needed for this workflow, but is mandated by the lint check _check_that_workflow_steps_use_merge_action() (and point to PR 13700). I'll talk to @U8NWXD about whether we should do anything long-term here. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HardikGoyal2003 I talked to @U8NWXD about this, and there is actually a constant here that you can put this workflow in to exempt it from the lint check in question.
So I want to amend my suggestion in the previous comment -- please instead add your workflow to that list, and drop the step altogether if this workflow does not need it. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Unassigning @HardikGoyal2003 since a re-review was requested. @HardikGoyal2003, please make sure you have addressed all review comments. Thanks! |
Responded! |
@U8NWXD PTAL!! Thanks! |
Unassigning @HardikGoyal2003 since a re-review was requested. @HardikGoyal2003, please make sure you have addressed all review comments. Thanks! |
Hey @Ash-2k3 PTAL!! Thanks! |
@seanlip PTAL!! Thanks! |
Unassigning @HardikGoyal2003 since a re-review was requested. @HardikGoyal2003, please make sure you have addressed all review comments. Thanks! |
@seanlip PTAL!! Thanks! |
Unassigning @HardikGoyal2003 since a re-review was requested. @HardikGoyal2003, please make sure you have addressed all review comments. Thanks! |
Unassigning @seanlip since they have already approved the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HardikGoyal2003 Sorry for the late review, I was quite busy with my internship and Oppia's Contract! Thanks for this creating this action, I think this is a great add on and will help us to keep track of new contributors so that we could help them. I just have one comment, more like a suggestion, PTAL.
script: | | ||
const prCount = parseInt(process.env.PR_COUNT); | ||
const author = process.env.AUTHOR; | ||
const mention = 'HardikGoyal2003'; // Update this if the mention needs to change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we include more mentions to ensure it gets seen, if in case one of the mentions is not active ? WDYT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add as many as you like. I initially included Afzal, but removed him due to unavailability. Once we have more onboarding leads or additional members in the welfare team, please let me know, and I will update it. Thanks!
Overview
Essential Checklist
Please follow the instructions for making a code change.
Proof that changes are correct
PR Pointers