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

Removes tier1 approval rules, sets triggers pull_request_reviews #629

Closed
wants to merge 2 commits into from

Conversation

jomitchellnv
Copy link
Collaborator

Description

  • Refactors the Tiered approval rules to omit tier 1 approvals since github handled that via the UI
  • Changes the on trigger to run during `pull_request_review"

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactor
  • Documentation update
  • Other (please describe):

CI Pipeline Configuration

Configure CI behavior by applying the relevant labels:

Note

By default, the notebooks validation tests are skipped unless explicitly enabled.

Usage

TODO: Add code snippet

Pre-submit Checklist

  • I have tested these changes locally
  • I have updated the documentation accordingly
  • I have added/updated tests as needed
  • All existing tests pass successfully

@jomitchellnv jomitchellnv added the SKIP_CI Completely skips the CI pipeline label Jan 21, 2025
@dorotat-nv dorotat-nv self-requested a review January 21, 2025 19:35
Copy link
Collaborator

@dorotat-nv dorotat-nv left a comment

Choose a reason for hiding this comment

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

Instead of having additional fiels, why not to use group tags for github? https://github.com/NVIDIA/Megatron-LM/blob/4fb4c3dc61b26784ccf804b340ba047bbcec3953/CODEOWNERS#L7

way easier to manage groups and their permissions and scopes

Comment on lines 15 to 42
- name: Checkout repository
uses: actions/checkout@v3

- name: Parse CODEOWNERS file
id: parse_codeowners
run: |
echo "Parsing CODEOWNERS file..."
declare -A CODEOWNERS
declare -A TIER2_REVIEWERS

while IFS= read -r line; do
# Skip comments and empty lines
[[ "$line" =~ ^#.*$ || -z "$line" ]] && continue

# Detect tier2 reviewers
if [[ "$line" =~ "# tier2" ]]; then
reviewers=$(echo "$line" | awk '{$1=""; $NF=""; print $0}' | xargs)
for reviewer in $reviewers; do
TIER2_REVIEWERS["$reviewer"]=1
done
continue
fi

done < CODEOWNERS

# Export TIER2 Reviewers as JSON
echo "$(declare -p TIER2_REVIEWERS)" > tier2reviewers.json
echo "TIER2 reviewers exported to JSON."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we just have the list of +2 approvers live in this workflow file? That way it's separated from the CODEOWNERS file, and we don't have to do this parsing step or the checkout step which saves us some CI time.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer to have a user group for that and use it here

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think its hidden if its inside this workflow and not available in the CODEOWNERS file.

Comment on lines 86 to 87
# Strip '@' from REVIEWER
CLEAN_REVIEWER="${REVIEWER#@}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

could probably remove if we just have a list of +2 folks in this action

Comment on lines 105 to 114
- name: Enforce approval requirements
run: |
echo "Enforcing approval requirements..."

if [[ "$tier2Approved" != "true" ]]; then
echo "ERROR: No +2 reviewer has approved the pull request."
exit 1
fi

echo "All tiered 2 approval requirements met. Proceeding."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we just merge this with the previous step?

@jomitchellnv jomitchellnv force-pushed the jm/approvals-wf-rules branch from 2928a25 to e0d1620 Compare January 22, 2025 19:37
Signed-off-by: Jonathan <[email protected]>
@pstjohn
Copy link
Collaborator

pstjohn commented Jan 23, 2025

closing in favor of #639

@pstjohn pstjohn closed this Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SKIP_CI Completely skips the CI pipeline
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants