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

[ENH] Standardized query result files #392

Merged
merged 6 commits into from
Dec 12, 2024
Merged
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
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -25,6 +25,8 @@ Changes proposed in this pull request:
-
-

**NOTE: If this pull request is to be released, the release label must be applied once the review process is done to avoid the local and remote from going out of sync as a consequence of the `bump version` workflow run**

<!-- To be checked off by reviewers -->
## Checklist
_This section is for the PR reviewer_
13 changes: 13 additions & 0 deletions .github/workflows/build_docker_nightly.yml
Original file line number Diff line number Diff line change
@@ -16,6 +16,19 @@ jobs:
with:
submodules: recursive

- name: Fetch latest commit SHA from main branch
id: fetch_sha
run: |
git fetch origin main
LATEST_SHA=$(git rev-parse --short=7 origin/main)
echo "LATEST_SHA=$LATEST_SHA" >> $GITHUB_ENV

- name: Update package.json version
run: |
SHA=${{ env.LATEST_SHA }}
jq ".version = \"build:${SHA}\"" package.json > tmp.$$.json && mv tmp.$$.json package.json
cat package.json

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
90 changes: 90 additions & 0 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: bump version

on:
pull_request:
types: [labeled]
workflow_dispatch:

permissions:
contents: write
pull-requests: write # Required to commit changes to PR branches

jobs:
bump-version:
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'release' }}
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.NB_BOT_ID }}
private-key: ${{ secrets.NB_BOT_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}

- 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: Get latest release version
id: latest-release
run: |
LATEST_TAG=$(curl -fsSL https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV

- name: Compute increment
id: compute-increment
run: |
# Run auto to determine version increment (patch, minor, major)
INCREMENT=$(~/auto version)
echo "Increment: $INCREMENT"
echo "INCREMENT=$INCREMENT" >> $GITHUB_ENV
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}

- name: Bump version
id: bump-version
run: |
# Extract the current version from the latest release
VERSION=${{ env.LATEST_TAG }}
VERSION=${VERSION#v} # Remove the "v" prefix if it exists

IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"

# Increment based on the auto output
if [ "${{ env.INCREMENT }}" == "major" ]; then
((MAJOR++))
MINOR=0
PATCH=0
elif [ "${{ env.INCREMENT }}" == "minor" ]; then
((MINOR++))
PATCH=0
elif [ "${{ env.INCREMENT }}" == "patch" ]; then
((PATCH++))
fi

# Construct the new version
NEW_VERSION="v$MAJOR.$MINOR.$PATCH"
echo "New version: $NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV

- name: Update package.json
run: |
jq ".version = \"$NEW_VERSION\"" package.json > package.json.tmp && mv package.json.tmp package.json
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}

- name: Commit and Push Changes
run: |
git config --global user.name "Neurobagel Bot"
git config --global user.email "neurobagel-bot[bot]@users.noreply.github.com"
git diff --quiet package.json || (git add package.json && git commit -m "Bumped version to $NEW_VERSION" && git push origin HEAD:${{ github.head_ref }})
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# v0.7.2 (Tue Dec 10 2024)

#### 🚀 Enhancements

- Revert "Updated formatting of download result files" ([@rmanaem](https://github.com/rmanaem))
- Revert "Updated the `ResultsTSV` e2e test" ([@rmanaem](https://github.com/rmanaem))

#### 🐛 Bug Fixes

- [FIX] Replaced the latest version tag with a baked-in version [#390](https://github.com/neurobagel/query-tool/pull/390) ([@rmanaem](https://github.com/rmanaem) [@neurobagel-bot[bot]](https://github.com/neurobagel-bot[bot]))

#### ⚠️ Pushed to `main`

- Updated the `ResultsTSV` e2e test ([@rmanaem](https://github.com/rmanaem))
- Updated formatting of download result files ([@rmanaem](https://github.com/rmanaem))

#### Authors: 2

- [@neurobagel-bot[bot]](https://github.com/neurobagel-bot[bot])
- Arman Jahanpour ([@rmanaem](https://github.com/rmanaem))

---

# v0.7.1 (Mon Dec 02 2024)

#### 🏠 Internal
22 changes: 11 additions & 11 deletions cypress/e2e/ResultsTSV.cy.ts
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ describe('Results TSV', () => {
});
});
describe('Unprotected response', () => {
it.only('Checks whether the rows in the participant.tsv file generated according to session_type', () => {
it('Checks whether the rows in the participant.tsv file generated according to session_type', () => {
cy.intercept('query?*', unprotectedResponse).as('call');
cy.intercept(
{
@@ -107,12 +107,12 @@ describe('Unprotected response', () => {
expect(phenotypicSession.split('\t')[4]).to.equal('ses-nb01');
expect(phenotypicSession.split('\t')[5]).to.equal('');
expect(phenotypicSession.split('\t')[6]).to.equal('Phenotypic');
expect(phenotypicSession.split('\t')[7]).to.equal('1');
expect(phenotypicSession.split('\t')[8]).to.equal('0');
expect(phenotypicSession.split('\t')[9]).to.equal('10.4');
expect(phenotypicSession.split('\t')[10]).to.equal('female');
expect(phenotypicSession.split('\t')[11]).to.equal('Major depressive disorder');
expect(phenotypicSession.split('\t')[12]).to.equal('multisource interference task');
expect(phenotypicSession.split('\t')[7]).to.equal('10.4');
expect(phenotypicSession.split('\t')[8]).to.equal('female');
expect(phenotypicSession.split('\t')[9]).to.equal('Major depressive disorder');
expect(phenotypicSession.split('\t')[10]).to.equal('multisource interference task');
expect(phenotypicSession.split('\t')[11]).to.equal('1');
expect(phenotypicSession.split('\t')[12]).to.equal('0');
expect(phenotypicSession.split('\t')[13]).to.equal('');
expect(phenotypicSession.split('\t')[14]).to.equal('');
expect(phenotypicSession.split('\t')[15]).to.equal('Flow Weighted, T2 Weighted');
@@ -127,12 +127,12 @@ describe('Unprotected response', () => {
expect(imagingSession.split('\t')[4]).to.equal('ses-nb01');
expect(imagingSession.split('\t')[5]).to.equal('/ds004116/sub-300101');
expect(imagingSession.split('\t')[6]).to.equal('Imaging');
expect(imagingSession.split('\t')[7]).to.equal('0');
expect(imagingSession.split('\t')[8]).to.equal('1');
expect(imagingSession.split('\t')[7]).to.equal('');
expect(imagingSession.split('\t')[8]).to.equal('');
expect(imagingSession.split('\t')[9]).to.equal('');
expect(imagingSession.split('\t')[10]).to.equal('');
expect(imagingSession.split('\t')[11]).to.equal('');
expect(imagingSession.split('\t')[12]).to.equal('');
expect(imagingSession.split('\t')[11]).to.equal('0');
expect(imagingSession.split('\t')[12]).to.equal('1');
expect(imagingSession.split('\t')[13]).to.equal('Flow Weighted, T2 Weighted');
expect(imagingSession.split('\t')[14]).to.equal('fmriprep 23.1.3, freesurfer 7.3.2');
expect(imagingSession.split('\t')[15]).to.equal('Flow Weighted, T2 Weighted');
Loading

Unchanged files with check annotations Beta

EXPOSE 5173
ENTRYPOINT npm run build && npm run preview

Check warning on line 11 in Dockerfile

GitHub Actions / build

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/