Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 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
7 changes: 7 additions & 0 deletions .qlty/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*
!configs
!configs/**
!hooks
!hooks/**
!qlty.toml
!.gitignore
2 changes: 2 additions & 0 deletions .qlty/configs/.hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignored:
- DL3008
Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify where DL3008 would apply and whether inline ignores are needed.
fd -0 -i '(Dockerfile|.*\.Dockerfile)$' -t f | while IFS= read -r -d '' f; do
  echo "== $f =="
  rg -n "apt-get\s+install" "$f"
  rg -n "hadolint ignore=DL3008" "$f"
done

Repository: YaoYinYing/REvoDesign

Length of output: 227


🏁 Script executed:

# Also check the current hadolint configuration
cat .qlty/configs/.hadolint.yaml

Repository: YaoYinYing/REvoDesign

Length of output: 84


🏁 Script executed:

# Check if there are any other hadolint configs in the repo
find . -name "*hadolint*" -type f

Repository: YaoYinYing/REvoDesign

Length of output: 95


🏁 Script executed:

# Get context around the apt-get install on line 21
sed -n '15,30p' ./server/docker/server/Dockerfile

Repository: YaoYinYing/REvoDesign

Length of output: 555


🏁 Script executed:

# Check the full Dockerfile to understand its purpose
wc -l ./server/docker/server/Dockerfile
head -30 ./server/docker/server/Dockerfile

Repository: YaoYinYing/REvoDesign

Length of output: 912


🏁 Script executed:

# Check the runner Dockerfile to see why it has no apt-get
head -30 ./server/docker/runner/Dockerfile

Repository: YaoYinYing/REvoDesign

Length of output: 1092


Avoid disabling DL3008 globally; prefer targeted ignores.

The global DL3008 disable suppresses version-pinning enforcement for the unversioned apt packages in ./server/docker/server/Dockerfile (line 21: build-essential curl procps). This reduces reproducibility and supply-chain hygiene. Either pin versions for these packages or use an inline # hadolint ignore=DL3008 comment if pinning is infeasible.

🧩 Suggested change (re‑enable DL3008)
-ignored:
-  - DL3008
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ignored:
- DL3008
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.qlty/configs/.hadolint.yaml around lines 1 - 2, Remove the global DL3008
suppression from .hadolint.yaml and instead address the concrete occurrences:
either pin the apt packages in ./server/docker/server/Dockerfile (the install of
build-essential curl procps) to specific versions, or keep the rule enabled and
add an inline hadolint ignore comment only on that apt RUN line (use "# hadolint
ignore=DL3008") so DL3008 remains enforced globally but ignored only where
pinning is infeasible.

1 change: 1 addition & 0 deletions .qlty/configs/.shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source-path=SCRIPTDIR
108 changes: 108 additions & 0 deletions .qlty/qlty.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# This file was automatically generated by `qlty init`.
# You can modify it to suit your needs.
# We recommend you to commit this file to your repository.
#
# This configuration is used by both Qlty CLI and Qlty Cloud.
#
# Qlty CLI -- Code quality toolkit for developers
# Qlty Cloud -- Fully automated Code Health Platform
#
# Try Qlty Cloud: https://qlty.sh
#
# For a guide to configuration, visit https://qlty.sh/d/config
# Or for a full reference, visit https://qlty.sh/d/qlty-toml
config_version = "0"

exclude_patterns = [
"*_min.*",
"*-min.*",
"*.min.*",
"**/.yarn/**",
"**/*.d.ts",
"**/assets/**",
"**/bower_components/**",
"**/build/**",
"**/cache/**",
"**/config/**",
"**/db/**",
"**/deps/**",
"**/dist/**",
"**/extern/**",
"**/external/**",
"**/generated/**",
"**/Godeps/**",
"**/gradlew/**",
"**/mvnw/**",
"**/node_modules/**",
"**/protos/**",
"**/seed/**",
"**/target/**",
"**/templates/**",
"**/testdata/**",
"**/vendor/**",
]

test_patterns = [
"**/test/**",
"**/spec/**",
"**/*.test.*",
"**/*.spec.*",
"**/*_test.*",
"**/*_spec.*",
"**/test_*.*",
"**/spec_*.*",
]

[smells]
mode = "comment"

[[source]]
name = "default"
default = true


[[plugin]]
name = "actionlint"

[[plugin]]
name = "bandit"

[[plugin]]
name = "hadolint"

[[plugin]]
name = "osv-scanner"

[[plugin]]
name = "radarlint-iac"
mode = "monitor"

[[plugin]]
name = "radarlint-python"
mode = "comment"

[[plugin]]
name = "ripgrep"
mode = "comment"

[[plugin]]
name = "ruff"
drivers = [
"lint",
]

[[plugin]]
name = "shellcheck"

[[plugin]]
name = "trivy"
drivers = [
"config",
"fs-vuln",
]

[[plugin]]
name = "trufflehog"

[[plugin]]
name = "zizmor"
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- logger control of uvicorn server. can be completely silenced.
- Server: logs now printed as debug messages.
- Language switch: logs now printed as debug messages.
- Tests:
- refactored tabs-case dependency flow to `pytest-dependency`:
- `TestREvoDesignPlugin` -> `TestREvoDesignPlugin_TabPrepare` -> downstream tab/action case classes.
- dropped active `pytest.mark.order` coupling in tabs bootstrap cases and enabled dependency-aware ordering with `--order-dependencies`.
- Test env/bootstrap:
- test dependencies and `make prepare-test` now include `pytest-dependency`.
- Server (PSSM_GREMLIN):
- Public/private dashboard behavior is now configurable with `PUBLIC_DASHBOARD` (`false` by default).
- Task visibility and API access are scoped to the authenticated upload owner when `PUBLIC_DASHBOARD=false`.
Expand All @@ -78,13 +84,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- notify box and decide box now works under subthreads.
- Tests:
- `test_pm_dialog_extras_panel_expand_collapse` now waites for the dialog to fully expand before asserting.
- `test_utils` archive extraction now covers zip/tar path traversal rejection.
- tab bootstrap dependencies are now session-scoped and `test_pick_design_from_profile` now depends on `tabs_prepare_pocket_session`, so CI runs pocket-session preparation before shortcut profile-picking tests.
- `make serial-test` now includes dependency-root `bootstrap` cases so dependency-selected child tests do not emit unresolved-marker warnings when roots were excluded by marker filters.
- Security hardening:
- archive extraction in `tools.utils.extract_archive` now validates member paths and rejects traversal entries before writing files.
- Monaco editor tarball setup now reuses the hardened archive extractor instead of raw `tar.extractall`.
- Server (PSSM_GREMLIN):
- task-id/content digest md5 calls now explicitly use `usedforsecurity=False` because they are non-cryptographic identifiers.
- Server (PSSM_GREMLIN):
- deleted task states are now terminal in sqlite update flow, preventing late worker writes (`packing results` / `finished`) from resurrecting tasks after user deletion.
- background GREMLIN runner now skips result packing/finalization when a task is deleted mid-execution, avoiding inconsistent post-delete artifacts/state.
- Docker daemon permission failure handling for non-root runtime users in server/worker execution paths.
- `run_stage` ORM/schema mismatch that caused sqlite update/compile failures and prevented task execution in server-image integration tests.
- Real-server missing result artifacts by packing outputs at job completion rather than delaying zip creation until download request.
- UniRef90 mount/prefix mismatch that caused runner exits like `/tmp/uniref90_db.fasta not found`.
- Host absolute path leakage in dashboard/API error messages by masking to virtual server paths (`/srv/REvoDesign/PSSM_GREMLIN/upload/<filename>`).
- Cross-user data exposure/unauthorized access paths on dashboard and task APIs when private mode is enabled.
- command execution hardening in `REvoDesign_PSSM_GREMLIN.sh`: replaced `eval`-based hhblits/hhfilter/remove-inserts/GREMLIN/psiblast invocations with array-based execution and preserved stdout/stderr log routing.

### Removed
- Server (PSSM_GREMLIN):
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ PIP_EXTRAS_OPTIONAL=rfdiffusion_cpu,esm2


TESTDIR=tmp-test-dir-with-unique-name
PYTEST_ARGS=--cov-config=../.coveragerc --cov-report=term-missing --cov=$(PROJECT) -v --pyargs --durations=0 -vv --emoji
PYTEST_ARGS=--cov-config=../.coveragerc --cov-report= --cov=$(PROJECT) -v --pyargs --durations-min=5 -vv --emoji
PYTEST_CASES_PATH=../tests
PYTEST_XDIST_ARGS=-n 4 -m "not serial"
PYTEST_NON_DIST_SERIAL_ARGS=-m "serial and not very_slow" --cov-append
PYTEST_NON_DIST_SLOW_SERIAL_ARGS=-m "serial and very_slow" --cov-append
PYTEST_NON_DIST_SERIAL_ARGS=-m "(serial and not very_slow) or bootstrap" --cov-append
PYTEST_NON_DIST_SLOW_SERIAL_ARGS=-m "(serial and very_slow) or bootstrap" --cov-append
Comment on lines +14 to +15

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find all test files and search for bootstrap marker usage
rg "@pytest\.mark\.bootstrap" --type py -A 2

Repository: YaoYinYing/REvoDesign

Length of output: 918


🏁 Script executed:

#!/bin/bash
# Find all test files and search for very_slow marker usage
rg "@pytest\.mark\.very_slow" --type py

Repository: YaoYinYing/REvoDesign

Length of output: 121


🏁 Script executed:

#!/bin/bash
# Check for tests marked with both bootstrap and very_slow
rg -B 5 "@pytest\.mark\.bootstrap" --type py | rg -A 5 "@pytest\.mark\.very_slow"

Repository: YaoYinYing/REvoDesign

Length of output: 47


🏁 Script executed:

#!/bin/bash
# Check the full Makefile context to understand how these variables are used
cat -n Makefile | head -30

Repository: YaoYinYing/REvoDesign

Length of output: 1693


Bootstrap tests execute twice across serial stages.

The 3 bootstrap tests in the codebase (test_plugin_gui_visibility, test_load_molecule, test_pocket) are not marked with very_slow. With or bootstrap in both PYTEST_NON_DIST_SERIAL_ARGS and PYTEST_NON_DIST_SLOW_SERIAL_ARGS, they match both marker expressions and run in both PYTEST_RUN_SECOND_ARGS and PYTEST_RUN_THIRD_ARGS, doubling runtime and risking flakiness. Route bootstrap tests into only one bucket by conditionally adding the very_slow marker.

Example fix (single execution by slow/fast bucket)
-PYTEST_NON_DIST_SERIAL_ARGS=-m "(serial and not very_slow) or bootstrap" --cov-append
-PYTEST_NON_DIST_SLOW_SERIAL_ARGS=-m "(serial and very_slow) or bootstrap" --cov-append
+PYTEST_NON_DIST_SERIAL_ARGS=-m "(serial and not very_slow) or (bootstrap and not very_slow)" --cov-append
+PYTEST_NON_DIST_SLOW_SERIAL_ARGS=-m "(serial and very_slow) or (bootstrap and very_slow)" --cov-append
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
PYTEST_NON_DIST_SERIAL_ARGS=-m "(serial and not very_slow) or bootstrap" --cov-append
PYTEST_NON_DIST_SLOW_SERIAL_ARGS=-m "(serial and very_slow) or bootstrap" --cov-append
PYTEST_NON_DIST_SERIAL_ARGS=-m "(serial and not very_slow) or (bootstrap and not very_slow)" --cov-append
PYTEST_NON_DIST_SLOW_SERIAL_ARGS=-m "(serial and very_slow) or (bootstrap and very_slow)" --cov-append
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 14 - 15, The bootstrap tests are being matched in both
PYTEST_NON_DIST_SERIAL_ARGS and PYTEST_NON_DIST_SLOW_SERIAL_ARGS so they run
twice; update the Makefile so bootstrap only matches the slow bucket by making
the slow expression require very_slow as well (i.e., change the
PYTEST_NON_DIST_SLOW_SERIAL_ARGS marker expression from 'or bootstrap' to 'or
(bootstrap and very_slow)') so tests like
test_plugin_gui_visibility/test_load_molecule/test_pocket only execute once.


# default keyword test keyword for all tests
PYTEST_KW=all
Expand Down Expand Up @@ -120,7 +120,7 @@ translate:
stage=release bash tools/translate.sh

prepare-test:
python -m pip install pytest pytest-cov pytest-order coverage -q --no-cache-dir
python -m pip install pytest pytest-cov pytest-order pytest-dependency coverage -q --no-cache-dir
python -m pip install "celery[redis]==5.3.4" docker==7.1.0 Flask==3.1.3 Flask-HTTPAuth==4.8.0 SQLAlchemy==2.0.46 -q --no-cache-dir

# unit test
Expand Down
Loading