Skip to content

Commit

Permalink
Merge branch 'neurobagel:main' into newWork
Browse files Browse the repository at this point in the history
  • Loading branch information
Sauradip07 authored Mar 8, 2024
2 parents ed88f3d + 99fc5c0 commit 72d1bfb
Show file tree
Hide file tree
Showing 16 changed files with 416 additions and 5 deletions.
118 changes: 118 additions & 0 deletions .autorc
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"onlyPublishWithReleaseLabel": true,
"noDefaultLabels": true,
"baseBranch": "main",
"author": "Chef Bot <[email protected]>",
"noVersionPrefix": false,
"plugins": [
"git-tag",
"released",
"protected-branch",
"first-time-contributor",
[
"omit-commits",
{
"username": "dependabot[bot]",
"subject": "[pre-commit.ci]",
"labels": "_bot"
}
]
],
"labels": [
{
"name": "pr-major-breaking",
"changelogTitle": "💥 Breaking Changes",
"description": "Significant behaviour change that breaks compatibility, will increment major version (+1.0.0)",
"releaseType": "major",
"overwrite": true,
"color": "#C5000B"
},
{
"name": "pr-minor-breaking",
"changelogTitle": "💥 Breaking Changes",
"description": "Feature or enhancement that breaks compatibility, will increment minor version (0.+1.0)",
"releaseType": "minor",
"overwrite": true,
"color": "#F1A60E"
},
{
"name": "pr-minor",
"changelogTitle": "🚀 Enhancements",
"description": "Non-breaking feature or enhancement, will increment minor version (0.+1.0)",
"releaseType": "minor",
"overwrite": true,
"color": "#F1A60E"
},
{
"name": "pr-patch",
"changelogTitle": "🚀 Enhancements",
"description": "Incremental feature improvement, will increment patch version when merged (0.0.+1)",
"releaseType": "patch",
"overwrite": true,
"default": true,
"color": "#870048"
},
{
"name": "pr-bug-fix",
"changelogTitle": "🐛 Bug Fixes",
"description": "Bug fix, will increment patch version when merged (0.0.+1)",
"releaseType": "patch",
"overwrite": true,
"color": "#870048"
},
{
"name": "pr-internal",
"changelogTitle": "🏠 Internal",
"description": "Non-user-facing code improvement, will increment patch version when merged (0.0.+1)",
"releaseType": "patch",
"overwrite": true,
"color": "#696969"
},
{
"name": "pr-performance",
"changelogTitle": "🏎 Performance Improvements",
"description": "Improve performance of an existing feature, will increment patch version when merged (0.0.+1)",
"releaseType": "patch",
"overwrite": true,
"color": "#f4b2d8"
},
{
"name": "pr-documentation",
"changelogTitle": "📝 Documentation",
"description": "Change that only affects user documentation",
"releaseType": "none",
"overwrite": true,
"color": "#cfd3d7"
},
{
"name": "pr-tests",
"changelogTitle": " 🧪 Tests",
"description": "Add or improve existing tests",
"releaseType": "none",
"overwrite": true,
"color": "#ffd3cc"
},
{
"name": "pr-dependencies",
"changelogTitle": "🔩 Dependency Updates",
"description": "Update one or more dependencies version",
"releaseType": "none",
"overwrite": true,
"color": "#8732bc"
},
{
"name": "skip-release",
"description": "PR doesn't appear in the changelog and preserves current version when merged",
"releaseType": "skip",
"overwrite": true,
"color": "#bf5416"
},
{
"name": "release",
"description": "Create a release when this PR is merged",
"releaseType": "release",
"overwrite": true,
"color": "#007f70"
}
]
}
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
47 changes: 47 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!--- Until this PR is ready for review, you can include [WIP] in the title, or create a draft PR. -->

<!---
Below is a suggested pull request template. Feel free to add more details you feel are relevant/necessary.
For more info on the Neurobagel PR process and other contributing guidelines, see https://neurobagel.org/contributing/CONTRIBUTING/.
-->

<!--
Please indicate after the # which issue you're closing with this PR, if applicable.
If the PR closes multiple issues, include "closes" before each one is listed.
You can also link to other issues if necessary, e.g. "See also #1234".
https://help.github.com/articles/closing-issues-using-keywords
-->

- Closes #

<!--
Please give a brief overview of what has changed or been added in the PR.
This can include anything specific the maintainers should be looking for when they review the PR.
-->

Changes proposed in this pull request:

-
-

<!-- To be checked off by reviewers -->

## Checklist

_This section is for the PR reviewer_

- [ ] PR has an interpretable title with a prefix (`[ENH]`, `[FIX]`, `[REF]`, `[TST]`, `[CI]`, `[MNT]`, `[INF]`, `[MODEL]`, `[DOC]`) _(see our [Contributing Guidelines](https://neurobagel.org/contributing/CONTRIBUTING#pull-request-guidelines) for more info)_
- [ ] PR has a label for the release changelog or `skip-release` (to be applied by maintainers only)
- [ ] PR links to GitHub issue with mention `Closes #XXXX`
- [ ] Tests pass
- [ ] Checks pass

For new features:

- [ ] Tests have been added

For bug fixes:

- [ ] There is at least one test that would fail under the original bug conditions.
16 changes: 16 additions & 0 deletions .github/workflows/add_iss2project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Add new issues to project

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@main
with:
project-url: https://github.com/orgs/neurobagel/projects/1
github-token: ${{ secrets.NB_PROJECT_PAT }}
26 changes: 26 additions & 0 deletions .github/workflows/build_docker_on_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: build Docker image on release

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/query_tool:latest, ${{ secrets.DOCKERHUB_USERNAME }}/query_tool:${{ github.event.release.tag_name }}
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Adapted from sample vite workflow file: https://vitejs.dev/guide/static-deploy#github-pages
name: deploy

on:
release:
types: [published]
workflow_dispatch:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
deploy:
# See docs: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#using-an-environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
with:
cache: 'npm'
- name: Create .env file
run: |
echo -e "NB_API_QUERY_URL=${{ vars.NB_API_QUERY_URL }}\nNB_IS_FEDERATION_API=${{ vars.NB_IS_FEDERATION_API }}" > .env
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
run: npm ci

- name: Run ESLint
run: npm run lint
run: npm run lint:check
28 changes: 28 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: auto release

on:
push:
branches:
- main

jobs:
auto-release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download latest auto
run: |
auto_download_url="$(curl -fsSL https://api.github.com/repos/intuit/auto/releases/latest | jq -r '.assets[] | select(.name == "auto-linux.gz") | .browser_download_url')"
wget -O- "$auto_download_url" | gunzip > ~/auto
chmod a+x ~/auto
- name: Release
run: ~/auto shipit -vv
env:
GH_TOKEN: ${{ secrets.NB_PAT_RELEASE }}
PROTECTED_BRANCH_REVIEWER_TOKEN: ${{ secrets.NB_PAT_RELEASE_PROTECTED }}
24 changes: 24 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
stale-issue-message: |
We want to keep our issues up to date and active. This issue hasn't seen any activity in the last 75 days.
We have applied the `_flag:stale` label to indicate that this issue should be reviewed again.
When you review, please reread the spec and then apply one of these three options:
- prioritize: apply the `flag:schedule` label to suggest moving this issue into the backlog now
- close: if the issue is no longer relevant, explain why (give others a chance to reply) and then close.
- archive: sometimes an issue has important information or ideas but we won't work on it soon. In this case
apply the `someday` label to show that this won't be prioritized. The stalebot will ignore issues with this
label in the future. Use sparingly!
days-before-stale: 75
days-before-close: -1
stale-issue-label: '_flag:stale'
exempt-issue-labels: 'Roadmap,Milestone,Epic,someday'
4 changes: 4 additions & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

git diff HEAD^ HEAD --exit-code -- ./package.json || npm ci
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged

2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"*.{ts,tsx}": ["npm run lint", "npm run format"]
"*.{ts,tsx}": ["npm run lint:check", "npm run format:check"]
}
Loading

0 comments on commit 72d1bfb

Please sign in to comment.