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

Fix #20381 : Added Github Action for developer Onboarding leads #20683

Merged
merged 6 commits into from
Aug 7, 2024

Conversation

HardikGoyal2003
Copy link
Member

Overview

  1. This PR fixes or fixes part of [Feature Request]: Notify developer onboarding leads about new contributors merged PRs #20381
  2. This PR does the following: Adds the GitHub action which will trigger when a PR gets merged in develop branch

Essential Checklist

Please follow the instructions for making a code change.

  • I have linked the issue that this PR fixes in the "Development" section of the sidebar.
  • I have checked the "Files Changed" tab and confirmed that the changes are what I want to make.
  • I have written tests for my code.
  • The PR title starts with "Fix #bugnum: " or "Fix part of #bugnum: ...", followed by a short, clear summary of the changes.
  • I have assigned the correct reviewers to this PR (or will leave a comment with the phrase "@{{reviewer_username}} PTAL" if I can't assign them directly).

Proof that changes are correct

image

PR Pointers

@HardikGoyal2003 HardikGoyal2003 requested a review from a team as a code owner July 16, 2024 15:25
@HardikGoyal2003 HardikGoyal2003 requested a review from U8NWXD July 16, 2024 15:25
Copy link

oppiabot bot commented Jul 16, 2024

Assigning @U8NWXD for the first pass review of this PR. Thanks!

@HardikGoyal2003
Copy link
Member Author

@seanlip This is the comment that needs to watch out from previous opened Pr #20382 (comment)

@HardikGoyal2003
Copy link
Member Author

@Ash-2k3 @seanlip @U8NWXD PTAL! Thanks!

@U8NWXD U8NWXD assigned HardikGoyal2003 and unassigned U8NWXD Jul 19, 2024
- name: Checkout repository
uses: actions/checkout@v4

- uses: ./.github/actions/merge
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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/

Copy link
Member Author

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.

Copy link
Member

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:

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.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

@seanlip This PR introduced it. and this is the function. Thanks!

Copy link
Member

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!

Copy link
Member

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!

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@seanlip seanlip removed their assignment Jul 19, 2024
@HardikGoyal2003
Copy link
Member Author

@seanlip @U8NWXD PTAL!! Thanks!

@oppiabot oppiabot bot assigned seanlip and U8NWXD and unassigned HardikGoyal2003 Jul 23, 2024
Copy link

oppiabot bot commented Jul 23, 2024

Unassigning @HardikGoyal2003 since a re-review was requested. @HardikGoyal2003, please make sure you have addressed all review comments. Thanks!

@U8NWXD
Copy link
Member

U8NWXD commented Jul 24, 2024

Responded!

@HardikGoyal2003
Copy link
Member Author

@U8NWXD PTAL!! Thanks!

Copy link

oppiabot bot commented Jul 29, 2024

Unassigning @HardikGoyal2003 since a re-review was requested. @HardikGoyal2003, please make sure you have addressed all review comments. Thanks!

@U8NWXD U8NWXD removed their assignment Jul 30, 2024
@HardikGoyal2003
Copy link
Member Author

Hey @Ash-2k3 PTAL!! Thanks!

@seanlip seanlip assigned HardikGoyal2003 and unassigned seanlip Aug 1, 2024
@HardikGoyal2003
Copy link
Member Author

@seanlip PTAL!! Thanks!

Copy link

oppiabot bot commented Aug 2, 2024

Unassigning @HardikGoyal2003 since a re-review was requested. @HardikGoyal2003, please make sure you have addressed all review comments. Thanks!

@HardikGoyal2003
Copy link
Member Author

@seanlip PTAL!! Thanks!

@oppiabot oppiabot bot assigned seanlip and unassigned HardikGoyal2003 Aug 7, 2024
Copy link

oppiabot bot commented Aug 7, 2024

Unassigning @HardikGoyal2003 since a re-review was requested. @HardikGoyal2003, please make sure you have addressed all review comments. Thanks!

@seanlip seanlip added this pull request to the merge queue Aug 7, 2024
@oppiabot oppiabot bot unassigned seanlip Aug 7, 2024
Copy link

oppiabot bot commented Aug 7, 2024

Unassigning @seanlip since they have already approved the PR.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 7, 2024
@HardikGoyal2003 HardikGoyal2003 added this pull request to the merge queue Aug 7, 2024
Merged via the queue into oppia:develop with commit 2f3683c Aug 7, 2024
125 checks passed
@HardikGoyal2003 HardikGoyal2003 deleted the onboarding branch August 7, 2024 17:06
Copy link
Member

@Ash-2k3 Ash-2k3 left a 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
Copy link
Member

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 ?

Copy link
Member Author

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!

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.

4 participants