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

Submission: Course Automation for Validation and Labeling #1106

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 28 additions & 8 deletions contributions/course-automation/siper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,33 @@ Simon Persson (siper@kth.se)
GitHub: altaired


## Proposal
## Submission

The action can be found at [https://github.com/altaired/devops-label](https://github.com/altaired/devops-label). The code is documented, tested and more information can be found in the repository itself.

The action does the following:
* Checks that only a single category is modified on each checked PR
* Checks that only a single folder in that category is modified
* That the naming structure of the authors folder holds, e.g 'name1-name2'
* If the PR is a proposal or not and assign a label if it is a proposal
* Fetches statistics of all pull requests with the proposal label and updates a provided issue with stats

In order to include the action in this repository, all details can be found in the repository above. A suggested configuration file is included in this directory as well (see [here](/contributions/course-automation/siper/config.yml)), the issue number has to be set though. Simply create an issue with an appropriate title and add the issue number in the configuration file where it currently says `<ISSUE_NUMBER>`. The version to use of this action is the latest (currently @v1.3).

Below is an example of how to use the action.
```
name: Validate and label PR
id: vlpr
uses: altaired/devops-label@v1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/config.yml
```

I recomend triggering it on each pull request, even if this does not update the stats when a PR is merged. As pull requests are made and updated regularly this should not be a problem.





I plan to make a github action that automatially asigns labels depending on the category of the proposal and a "proposal" label (if it is a new proposal). The action should also validate the folder naming structure and that a README file is included properly. This would allow the TA's to easily filter out what PR:s to check.

In order to achive this, the following will have to be done:
* Validate the folder structure and README on each push
* Check on each PR what file / files has been modified, to determine what category the PR is related to. Also check if files that should't have been modified are included and if that's the case, return an error to the user.
* Assign the appropriate labels
* Report back the status if the PR is following the required structure.
* Create a report showing statistics over the number of proposals.
38 changes: 38 additions & 0 deletions contributions/course-automation/siper/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
issue: <ISSUE_NUMBER>
dir: contributions/**
categories:
course-automation:
suffix: '**' # Set to '*' to not allow folders
proposal: README.md # The name of the proposal file
folder: +([a-zA-Z0-9])?(-+([a-zA-Z0-9])) # Glob for validating the folder account names
glob: contributions/course-automation/
presentation:
suffix: '**'
proposal: README.md
folder: +([a-zA-Z0-9])?(-+([a-zA-Z0-9]))
glob: contributions/presentation/week[1-9]/
demo:
suffix: '**'
proposal: README.md
folder: +([a-zA-Z0-9])?(-+([a-zA-Z0-9]))?(-+([a-zA-Z0-9]))
glob: contributions/demo/
essay:
suffix: '**'
proposal: README.md
folder: +([a-zA-Z0-9])?(-+([a-zA-Z0-9]))?(-+([a-zA-Z0-9]))
glob: contributions/essay/
executable-tutorial:
suffix: '**'
proposal: README.md
folder: +([a-zA-Z0-9])?(-+([a-zA-Z0-9]))
glob: contributions/executable-tutorial/
feedback:
suffix: '**'
proposal: README.md
folder: +([a-zA-Z0-9])?(-+([a-zA-Z0-9]))
glob: contributions/feedback/
open-source:
suffix: '**'
proposal: README.md
folder: +([a-zA-Z0-9])?(-+([a-zA-Z0-9]))?(-+([a-zA-Z0-9]))
glob: contributions/open-source/