Skip to content

Commit

Permalink
Merge pull request #3 from CSHS-CWRA/workflows_standards
Browse files Browse the repository at this point in the history
GitHub workflows and top-level content
  • Loading branch information
analytophile authored Aug 8, 2023
2 parents e16da53 + b383d76 commit d90233b
Show file tree
Hide file tree
Showing 14 changed files with 464 additions and 32 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/0001-GENERIC-ISSUE-TEMPLATE.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Generic issue template
description: For detailing generic/uncategorized issues in Xclim

body:
- type: textarea
id: generic-issue
attributes:
label: Generic Issue
description: Please fill in the following information fields as needed.
value: |
* Raven version:
* Operating System:
### Description
<!--Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.-->
### What I Did
<!--Paste the command(s) you ran and the output.
If there was a crash, please include the traceback below.-->
```
$ raven --foo bar
```
### What I Received
<!--Paste the output or the stack trace of the problem you experienced here.-->
```
Exception occurred
Math error: Attempted to divide by Zero
```
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/0002-BUG-REPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Bug report
description: Help us improve Xclim
labels: [ "bug" ]

body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: setup-information
attributes:
label: Setup Information
description: |
What software versions are you running?
value: |
- Raven version:
- Operating System:
- type: textarea
id: description
attributes:
label: Description
description: Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps To Reproduce
description: Paste the command(s) you ran and the output. If there was a crash, please include the traceback below.
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context about the problem here.
- type: checkboxes
id: submit-pr
attributes:
label: Contribution
description: Do you intend to submit a fix for this bug? (The xclim developers will help with code compliance)
options:
- label: I would be willing/able to open a Pull Request to address this bug.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/0003-FEATURE-REQUEST.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Feature request
description: Suggest an idea for this project
labels: [ "enhancement" ]

body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
- type: textarea
id: problem
attributes:
label: Addressing a Problem?
description: Is your feature request related to a problem? Please describe it.
- type: textarea
id: potential-solution
attributes:
label: Potential Solution
description: Describe the solution you'd like to see implemented.
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context about the feature request here.
- type: checkboxes
id: submit-pr
attributes:
label: Contribution
description: Do you intend to submit a fix for this bug? (The xclim developers will help with code compliance)
options:
- label: I would be willing/able to open a Pull Request to contribute this feature.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/0004-QUESTION-SUPPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Question/Support
description: Ask for help from the developers
labels: [ "support" ]

body:
- type: textarea
id: setup-information
attributes:
label: Setup Information
description: |
What software versions are you running?
value: |
- Raven version:
- Operating System:
- type: textarea
id: description
attributes:
label: Context
description: Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.
value: |
<!--- Please be as detailed as possible. -->
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--Please ensure the PR fulfills the following requirements! -->
<!-- If this is your first PR, make sure to add your details to the AUTHORS.rst! -->
### Pull Request Checklist:
- [ ] This PR addresses an already opened issue (for bug fixes / features)
- This PR fixes #xyz
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] (If applicable) Documentation has been added / updated (for bug fixes / features)
- [ ] CHANGES.rst has been updated (with summary of main changes)

### What kind of change does this PR introduce?

* ...

### Does this PR introduce a breaking change?
<!-- If so, please describe the impact and migration path for existing applications -->

* ...

### Other information:
<!-- Any other information that is of relevance to this PR, such as screenshots or references to external documentation. -->
46 changes: 46 additions & 0 deletions .github/workflows/first_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: First Pull Request

on:
pull_request_target:
types:
- opened

jobs:
welcome:
name: Welcome
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
// Get a list of all issues created by the PR opener
// See: https://octokit.github.io/rest.js/#pagination
const creator = context.payload.sender.login
const opts = github.rest.issues.listForRepo.endpoint.merge({
...context.issue,
creator,
state: 'all'
})
const issues = await github.paginate(opts)
for (const issue of issues) {
if (issue.number === context.issue.number) {
continue
}
if (issue.pull_request) {
return // Creator is already a contributor.
}
}
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `**Welcome**, new contributor!
It appears that this is your first Pull Request. To give credit where it's due, we ask that you add your information to the \`AUTHORS.md\` and \`.zenodo.json\`:
- [ ] The relevant author information has been added to \`AUTHORS.md\` and \`.zenodo.json\`
Please make sure you've read our [contributing guide](CONTRIBUTING.md). We look forward to reviewing your Pull Request shortly ✨`
})
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
default_language_version:
python: python3

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-json
- id: pretty-format-json
args: ['--autofix', '--no-ensure-ascii', '--no-sort-keys']
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.3
hooks:
- id: check-github-workflows
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: quarterly
skip: [ ]
submodules: false
Loading

0 comments on commit d90233b

Please sign in to comment.