Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d07b8e5
CAS_API_TOKEN
NishaSharma14 Oct 9, 2025
3043071
run formatting
NishaSharma14 Oct 9, 2025
ebaee12
fix: create seperate service for CAS APi integration
NishaSharma14 Oct 9, 2025
a1ec532
copilot review changes
NishaSharma14 Oct 9, 2025
a512f25
fix review comments
NishaSharma14 Oct 12, 2025
d534190
fix: controller and service function naming updates and other minor …
vcnainala Oct 27, 2025
acdc622
fix: enabled env based cas provider configuration
vcnainala Oct 27, 2025
62d5c57
chore: pint changes
vcnainala Oct 27, 2025
ac6f7aa
Merge pull request #1274 from NFDI4Chem/implement-CAS-import-issue#578
vcnainala Oct 27, 2025
29db366
feat: refactor support bubble to block spamming. (#1281)
NishaSharma14 Oct 27, 2025
c8321ad
fix: removed recaptcha from env example
NishaSharma14 Oct 28, 2025
a7a84c2
chore: configure laravel CSP (#1272)
NishaSharma14 Oct 28, 2025
0037bcc
fix: update Nmrxiv policy and routes fro csp
NishaSharma14 Oct 29, 2025
9c66cd2
fix: add additional CSP sources via environment variables
NishaSharma14 Oct 29, 2025
036d81b
pint formatting
NishaSharma14 Oct 29, 2025
40ffa98
Merge branch 'main' into development
NishaSharma14 Oct 30, 2025
de54c76
revert csp tags in dev images
NishaSharma14 Oct 30, 2025
52390b9
feat: enable search,filtering & pagination, unify badge logic project…
NishaSharma14 Nov 24, 2025
f36df77
feat: csp fixes and add missing endpoints in the policy (#1284)
NishaSharma14 Nov 24, 2025
ef86ddf
feat: add test and coverage workflow (#1286)
NishaSharma14 Nov 24, 2025
0ca6a6c
feat: add tests for models (#1288)
NishaSharma14 Dec 2, 2025
039e405
feat: project test (#1289)
NishaSharma14 Dec 2, 2025
95ddd5e
chore: csp optimization (#1299)
NishaSharma14 Dec 2, 2025
8079434
feat: add tests for study features (#1291)
NishaSharma14 Dec 2, 2025
562fb7e
feat:add test for draft feature and draft actions (#1293)
NishaSharma14 Dec 2, 2025
a96d955
test: add test for FileSystemController
NishaSharma14 Dec 3, 2025
9bfd014
rename FileSystemControllerTest.php to FileSystemTest.php
NishaSharma14 Dec 3, 2025
d667cd5
Merge remote-tracking branch 'origin/main' into development
NishaSharma14 Dec 3, 2025
13cf51c
fix: update composer.lock file
NishaSharma14 Dec 3, 2025
35123e2
fix:remove the test test_user_drafts_action_gets_user_drafts
NishaSharma14 Dec 3, 2025
2988cab
Merge branch 'development' into filesystem-test
vcnainala Dec 4, 2025
7d31cf9
build: upgrade PHP from 8.2 to 8.4 (#1307)
NishaSharma14 Dec 4, 2025
e27fe30
test: add announcement feature test
NishaSharma14 Dec 4, 2025
f4b3928
test: add application feature test
NishaSharma14 Dec 4, 2025
0a904db
test: add test for CAS integration
NishaSharma14 Dec 4, 2025
57ed601
test: add test for dashboard controller
NishaSharma14 Dec 4, 2025
a422076
test: add test for download controller
NishaSharma14 Dec 4, 2025
597c170
test: add test for file upload feature
NishaSharma14 Dec 4, 2025
3478f76
test: add tests for the admin controller
NishaSharma14 Dec 4, 2025
3520922
Merge remote-tracking branch 'origin/filesystem-test' into controller…
NishaSharma14 Dec 4, 2025
080fe80
fix: remove duplicate AnnouncementTest.php file
NishaSharma14 Dec 4, 2025
468ad7d
fix: rectify namespace in AnnouncementTest
NishaSharma14 Dec 4, 2025
023fc5b
fix: copilot review changes
NishaSharma14 Dec 5, 2025
2fc23ff
Merge pull request #1310 from NFDI4Chem/controller-test
vcnainala Dec 11, 2025
6637646
test: add test for dataset controller. (#1314)
NishaSharma14 Dec 11, 2025
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
64 changes: 59 additions & 5 deletions .env.ci.test → .env.ci
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ APP_ENV=development
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost:80

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database
PHP_CLI_SERVER_WORKERS=4

BCRYPT_ROUNDS=12
APP_DESCRIPTION='nmrXiv is currently developed as the FAIR, consensus-driven NMR data repository and computational platform. The ultimate goal is to accelerate broader coordination and data sharing among natural product (NP) researchers by enabling the storage, management, sharing and analysis of NMR data.'
COOL_OFF_PERIOD=10
SCHEMA_VERSION=beta
Expand All @@ -14,23 +23,31 @@ EUROPEMC_WS_API=https://www.ebi.ac.uk/europepmc/webservices/rest/search
ORCID_ID_SEARCH_API=https://pub.orcid.org/v2.1/search
ORCID_ID_EMPLOYMENT_API=https://pub.orcid.org/v3.0/{orcid_id}/employments
ORCID_ID_PERSON_API=https://pub.orcid.org/v3.0/{orcid_id}/person
CM_API=https://api.cheminf.studio/latest/
CROSSREF_API=https://api.crossref.org/works/
DATACITE_API=https://api.datacite.org/
DATACITE_TEST_API=https://api.test.datacite.org

LOG_CHANNEL=stack
LOG_STACK=single
LOG_LEVEL=debug

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=nmrxiv
DB_DATABASE=nmrxiv_test
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_PASSWORD=password

BROADCAST_CONNECTION=log
CACHE_STORE=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

MEMCACHED_HOST=memcached

Expand Down Expand Up @@ -58,6 +75,7 @@ AWS_BUCKET=nmrxiv
AWS_BUCKET_PUBLIC=nmrxiv-public
AWS_ENDPOINT=https://s3.uni-jena.de
AWS_URL=https://s3.uni-jena.de
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
Expand All @@ -67,9 +85,9 @@ PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

SCOUT_DRIVER=meilisearch
SCOUT_PREFIX=dev_
MEILISEARCH_HOST=https://msdev.nmrxiv.org
SCOUT_DRIVER=null
SCOUT_PREFIX=test_
MEILISEARCH_HOST=http://localhost:7700/
MEILISEARCH_KEY=
MEILISEARCH_PUBLICKEY=

Expand All @@ -81,4 +99,40 @@ TWITTER_CLIENT_ID=
TWITTER_CLIENT_SECRET=
TWITTER_REDIRECT_URL=http://localhost:80/auth/login/twitter/callback

ORCID_CLIENT_ID=
ORCID_CLIENT_SECRET=
ORCID_REDIRECT_URL=http://localhost/auth/login/orcid/callback
ORCID_ENVIRONMENT=sandbox

NFDIAAI_CLIENT_ID=
NFDIAAI_CLIENT_SECRET=
NFDIAAI_REDIRECT_URL="${APP_URL}/auth/login/regapp/callback"

TELESCOPE_ENABLED=false

#DATACITE Properties
DOI_HOST=datacite
DATACITE_USERNAME=
DATACITE_SECRET=
DATACITE_PREFIX=
DATACITE_ENDPOINT=https://api.test.datacite.org

NMRKIT_URL=https://nodejs.nmrxiv.org
PUBCHEM_URL=https://pubchem.ncbi.nlm.nih.gov
COMMON_CHEMISTRY_URL=https://commonchemistry.cas.org/api
CAS_API_TOKEN=
CHEMISTRY_STANDARDIZE_URL=https://api.cheminf.studio/latest/chem/standardize

BACKUP_KEEP_DAYS=7

# CSP Configuration
CSP_ENABLED=true
CSP_REPORT_URI="/csp-violation-report"
CSP_NONCE_ENABLED=true
CSP_ENABLED_WHILE_HOT_RELOADING=false

# Additional CSP sources (comma-separated, no spaces)
# CSP_ADDITIONAL_CONNECT_SRC="https://api.example.com,https://analytics.example.com"
# CSP_ADDITIONAL_IMG_SRC="https://cdn.example.com,https://images.example.com"
# CSP_ADDITIONAL_SCRIPT_SRC="https://cdn.example.com"
# CSP_ADDITIONAL_STYLE_SRC="https://fonts.example.com"
20 changes: 16 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ORCID_ID_PERSON_API=https://pub.orcid.org/v3.0/{orcid_id}/person
CM_API=https://api.cheminf.studio/latest/
CROSSREF_API=https://api.crossref.org/works/
DATACITE_API=https://api.datacite.org/
DATACITE_TEST_API=https://api.test.datacite.org


LOG_CHANNEL=stack
Expand Down Expand Up @@ -115,12 +116,23 @@ DOI_HOST=datacite
DATACITE_USERNAME=
DATACITE_SECRET=
DATACITE_PREFIX=
DATACITE_ENDPOINT=
DATACITE_ENDPOINT=https://api.test.datacite.org

NMRKIT_URL=https://nodejs.nmrxiv.org
CAS_URL=https://commonchemistry.cas.org
PUBCHEM_URL=https://pubchem.ncbi.nlm.nih.gov
COMMON_CHEMISTRY_URL=https://commonchemistry.cas.org
COMMON_CHEMISTRY_URL=https://commonchemistry.cas.org/api
CAS_API_TOKEN=
CHEMISTRY_STANDARDIZE_URL=https://api.cheminf.studio/latest/chem/standardize

BACKUP_KEEP_DAYS=7
BACKUP_KEEP_DAYS=7

# CSP Configuration
CSP_ENABLED=true
CSP_NONCE_ENABLED=false
CSP_ENABLED_WHILE_HOT_RELOADING=false

# Additional CSP sources (comma-separated, no spaces)
# CSP_ADDITIONAL_CONNECT_SRC="https://api.example.com,https://analytics.example.com"
# CSP_ADDITIONAL_IMG_SRC="https://cdn.example.com,https://images.example.com"
# CSP_ADDITIONAL_SCRIPT_SRC="https://cdn.example.com"
# CSP_ADDITIONAL_STYLE_SRC="https://fonts.example.com"
2 changes: 1 addition & 1 deletion .github/workflows/lint-security-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'
coverage: none
tools: composer
extensions: mbstring, intl, pdo, pdo_mysql, pdo_pgsql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR Lint & Security
name: PR Lint, Security and Tests

on:
pull_request:
Expand All @@ -10,6 +10,8 @@ on:
permissions:
contents: read
security-events: write
pull-requests: write
checks: write

jobs:
lint-security:
Expand All @@ -19,3 +21,8 @@ jobs:
run_php: true
run_js: true
run_secrets: true

test-coverage:
name: Tests & Coverage (PHP 8.4)
uses: ./.github/workflows/test-coverage.yml
secrets: inherit
79 changes: 79 additions & 0 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: PHPUnit Tests & Coverage Analysis

on:
workflow_call:

jobs:
test-coverage:
name: Tests & Coverage (PHP 8.4)
runs-on: ubuntu-latest

services:
postgres:
image: postgres:17
env:
POSTGRES_DB: nmrxiv_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, bcmath, soap, intl, gd, exif, iconv
coverage: pcov

- name: Cache Composer packages
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install composer dependencies
run: composer install --ignore-platform-reqs

- name: Prepare Laravel Application
run: |
php -r "file_exists('.env') || copy('.env.ci', '.env');"

echo AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID_DEV }} >> .env
echo AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }} >> .env
echo MEILISEARCH_KEY=${{ secrets.MEILISEARCH_KEY_DEV }} >> .env
echo MEILISEARCH_PUBLICKEY=${{ secrets.MEILISEARCH_PUBLICKEY_DEV }} >> .env

php artisan key:generate
php artisan migrate --seed

- name: Cache Node modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install front-end dependencies
run: npm ci

- name: Build front-end assets
run: npm run build

- name: Run tests and collect coverage
run: vendor/bin/phpunit --coverage-clover coverage.xml --display-skipped

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/vendor
.env
.env.production
.env.*
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Expand All @@ -24,3 +23,8 @@ docs/.vitepress/cache
**/caddy
frankenphp
frankenphp-worker.php

# Coverage reports
coverage.xml
coverage-report/
.phpunit.cache
1 change: 0 additions & 1 deletion .phpunit.cache/test-results

This file was deleted.

16 changes: 13 additions & 3 deletions app/Actions/Project/ArchiveProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,24 @@ class ArchiveProject
* @param mixed $project
* @return void
*/
public function toggle($project)
public function toggleArchive($project)
{
$archiveState = ! $project->is_archived;
$project->studies()->update(['is_archived' => $archiveState]);
$project->studies()->update([
'is_archived' => $archiveState,
'status' => $archiveState ? 'archived' : 'published',
]);

foreach ($project->studies as $study) {
$study->datasets()->update(['is_archived' => $archiveState]);
$study->datasets()->update([
'is_archived' => $archiveState,
'status' => $archiveState ? 'archived' : 'published',
]);
}

$project->is_archived = $archiveState;
$project->status = $archiveState ? 'archived' : 'published';

if ($project->is_archived) {
$project->sendNotification('archival', $this->prepareSendList($project));
}
Expand Down
2 changes: 1 addition & 1 deletion app/Actions/Project/CreateNewProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CreateNewProject
*/
public function create(array $input)
{
$license = $input['license'];
$license = $input['license'] ?? null;
$errorMessages = [
'license.required_if' => 'The license field is required when the project is made public.',
];
Expand Down
5 changes: 3 additions & 2 deletions app/Actions/Project/DeleteProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public function delete($project)
} else {
$project->studies()->update(['is_deleted' => true]);
foreach ($project->studies as $study) {
$study->update(['is_deleted' => true]);
$study->datasets()->update(['is_deleted' => true]);
$study->update(['is_deleted' => true, 'status' => 'deleted']);
$study->datasets()->update(['is_deleted' => true, 'status' => 'deleted']);
}
$draft = $project->draft;
if ($draft) {
Expand All @@ -40,6 +40,7 @@ public function delete($project)
$project->name = $project->name;
$project->deleted_on = Carbon::now();
$project->is_deleted = true;
$project->status = 'deleted';
$project->sendNotification('deletion', $this->prepareSendList($project));
}
$project->save();
Expand Down
6 changes: 4 additions & 2 deletions app/Actions/Project/RestoreProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ public function restore($project)
$study->datasets()->update(['is_deleted' => false]);
}
$draft = $project->draft;
$draft->is_deleted = false;
$draft->save();
if ($draft) {
$draft->is_deleted = false;
$draft->save();
}
$project->is_deleted = false;
$project->save();
}
Expand Down
Loading
Loading