about summary refs log tree commit diff
path: root/gn3
AgeCommit message (Collapse)Author
7 daysDeactivate the gnqa endpoints. HEAD mainFrederick Muriuki Muriithi
2026-10-12gemma: remove the broken /api/gemma endpoints and their unreachable codePjotr
gn3/computations/gemma.py's generate_gemma_cmd always appended "-gk" to every composed command, including its gwa-compute/k-gwa-compute endpoints that also set -lmm. Confirmed by actually running the composed command against real gemma-wrapper/GEMMA: real GEMMA rejects that combination outright ("only one of -gk ... -lmm ... options is allowed"), so none of these endpoints could ever produce output. tests/integration/test_gemma.py was entirely @unittest.skip, so this was never caught. Checked that GeneNetwork2 never called these endpoints over HTTP (no reference to api/gemma, k-compute, gwa-compute or k-gwa-compute anywhere in its codebase) -- it runs gemma-wrapper itself directly (wqflask/marker_regression/gemma_mapping.py), via its own GEMMA_WRAPPER_COMMAND and os.system() calls, never through GN3's API. So these endpoints had no real caller on either side. Removed: - gn3/api/gemma.py and its blueprint registration in gn3/app.py. - generate_gemma_cmd and generate_pheno_txt_file from gn3/computations/gemma.py (gn3/api/gemma.py was their only caller). generate_hash_of_string stays: GeneNetwork2 imports it directly (gemma_mapping.py, export_traits.py, views.py), and gn3/computations/rqtl.py uses it too. - compose_gemma_cmd from gn3/commands.py (generate_gemma_cmd was its only caller), and the now-unused `List` import that went with it. - tests/integration/test_gemma.py (tested only the removed blueprint). - The generate_gemma_cmd/generate_pheno_txt_file tests from tests/unit/computations/test_gemma.py and the compose_gemma_cmd tests from tests/unit/test_commands.py; generate_hash_of_string's and compose_rqtl_cmd's own tests stay. - CACHEDIR and GEMMA_WRAPPER_CMD from gn3/settings.json: both were read only by the removed gn3/api/gemma.py. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-09api: check dataset is public before serving sample dataPjotr
sampledata.get_sampledata and lmdb_sample_data.get_sample_data read LMDB directly by dataset/trait name with no check that the dataset is public and non-confidential. Add dataset_is_public() to db_utils, checked against ProbeSetFreeze/PublishFreeze/GenoFreeze, and use it in both handlers to return 404 before touching LMDB when the dataset isn't found or isn't public. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-06Fix PCA logiczsloan
Previously it was using the correlation table as input instead of the actual traits, so the results were completely wrong There was also a missing transpose from the GN2 version
2026-10-06Allow csvcmp to handle different delimiterszsloan
2026-10-06bug: Fix bug where any edits to a trait with no values were wrongly being ↵zsloan
intercepted
2026-09-01Initialise the listing of species.Frederick Muriuki Muriithi
2026-09-01Add the root endpoint and documentation to help use the API.Frederick Muriuki Muriithi
Add a root endpoint for the GN3 system. Use the HATEOAS paradigm (or adjacent) to help with discovery of the API.
2026-08-31fix(api): migrate auth/system/roles → auth/resource/system/rolesClaude
Update the two call-sites (metadata.py and case_attributes.py) to use the non-deprecated endpoint path.
2026-08-28Fix __population_privileges__: pass Bearer token to resource roles endpointClaude Sonnet 4.6
GET /auth/resource/<id>/roles requires authentication. The call was made without an Authorization header, so the auth server always returned an error and resource_privs was always an empty tuple. The resource_spec branch of can_edit (gn_libs.privileges.resources) was therefore permanently unreachable, meaning resource-owners could never edit case attributes via their role. The system roles call on the line below correctly forwarded the bearer token; this applies the same pattern to the resource roles call. Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-08-28refactor(case-attr): remove dead required_access helperFrederick Muriuki Muriithi
required_access is no longer called anywhere — both approve and reject now use __population_privileges__ + resources.can_apply_or_reject_edit. Also removes the Union and _HTTPException imports that were only used by required_access. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-08-28feat(case-attr): add deprecation headers to flat caseattr blueprintFrederick Muriuki Muriithi
All flat /case-attribute/ endpoints now return: Deprecation: true Link: </api/v1/>; rel="successor-version" Implemented via @caseattr.after_request so it applies automatically to every existing and future flat endpoint without per-function changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriith <fredmanglis@gmail.com>
2026-08-28fix(case-attr): replace required_access with can_apply_or_reject_editFrederick Muriuki Muriithi
approve_case_attributes_diff and reject_case_attributes_diff were using the old required_access helper which checked a single wrong privilege name (system:inbredset:edit-case-attribute). Replace with __population_privileges__ + resources.can_apply_or_reject_edit, consistent with the v1 endpoints. Flat endpoints derive species_id from the DB since it is not in the URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-08-28fix(case-attr): add can_edit privilege check to edit endpointsFrederick Muriuki Muriithi
Both the flat and v1 edit endpoints had @require_token but no privilege check, so any valid token could queue an edit. - edit_case_attributes (flat): fetch species_id from DB, call __population_privileges__, raise AuthorisationError if not can_edit. - v1_edit_case_attributes: same pattern; species_id comes from the URL. Case-attribute names remain publicly accessible (no token required). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-08-27api: add v1 blueprint hierarchy for species/populations/case-attributesFrederick Muriuki Muriithi
Introduces a nested blueprint structure that provides clean RESTful URLs alongside the existing flat endpoints (which are left unchanged): /api/v1/species/<s>/populations/<p>/case-attributes/ /api/v1/species/<s>/populations/<p>/case-attributes/edit (POST) /api/v1/species/<s>/populations/<p>/case-attributes/diffs/<t>/list /api/v1/species/<s>/populations/<p>/case-attributes/diffs/<id>/approve /api/v1/species/<s>/populations/<p>/case-attributes/diffs/<id>/reject New files: * gn3/api/version01.py — top-level v1 blueprint; registers speciesbp at /species * gn3/api/species.py — species blueprint; registers popbp; stubs list/detail (501) * gn3/api/populations.py — populations blueprint; registers caseattrsbp; stubs (501) Changes to existing files: * gn3/api/case_attributes.py — adds caseattrsbp Blueprint and v1_ route handlers that delegate to the existing private helper functions; **kwargs absorbs species_id so existing logic only needs pop_id (= InbredSet ID) * gn3/app.py — registers v01 at /api/v1 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-06-26Bug: Check for valid "Bearer" section.Frederick Muriuki Muriithi
2026-06-26Handle structurally invalid tokens.Frederick Muriuki Muriithi
In case the token passed is not a JWT, that's a structurally invalid token and will cause a DecodeError regardless of how many keys it's validated against, so it makes sense to bail early.
2026-05-28Swap the values for 'name' and 'fullName'.Frederick Muriuki Muriithi
This commit fixes the values for the "name" and "fullName" fields, which, prior to this commit, seem to have been swapped.
2026-05-28Fix some minor issues caught by the linter.Frederick Muriuki Muriithi
2026-05-28Convert exception objects to strings directlyFrederick Muriuki Muriithi
The .join(...) call assumes the arguments to the exception are always strings. This assumption is wrong, and leads to failure when attempting to report the previous failure.
2026-05-28Return 401 (Unauthorized) for AuthorisationError exceptions.Frederick Muriuki Muriithi
2026-05-28Pass missing argument.Frederick Muriuki Muriithi
2026-04-29Fix how Batch Edit handles SE/N editszsloan
2026-04-17Retain the error log, but make it much less noisy.Frederick Muriuki Muriithi
Retain the error logs for handled errors, but make them much less noisy to make it easier to go through the logs without the noise making the logs nigh incomprehensible.
2026-04-17Use module-level logging, rather than current_app logging.Frederick Muriuki Muriithi
2026-03-31Update imports after upstream changesFrederick Muriuki Muriithi
Update the `can_edit` import after changes to upstream `gn-libs` library.
2026-03-30metadata edit: Update authorisation.Frederick Muriuki Muriithi
* Update authorisation paradigm for metadata edits. * Leave some notes for @bonfacem to have a look at in order to fix any misunderstandings I might have had about the code.
2026-02-09refactor: remove null traits from results.Alexander_Kabui
2026-02-09Add ".json" extension to lmdb end-point.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2026-02-07feat: register lmdb traits blueprint.Alexander_Kabui
2026-02-07feat: Add endpoints to fetch lmdb traits.Alexander_Kabui
2026-01-13Handle CURIE-style ids when fetching dataset metadata.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2026-01-13Delete dead comment.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2026-01-13Minor API cleanup around JSON-LD framing and compation.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2026-01-13Type ignore gn_lib.http_logging.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2026-01-06Use module's logger rather than global logging.Frederick Muriuki Muriithi
2026-01-06Extend/modify the envvars rather than overridingFrederick Muriuki Muriithi
If env is provided for subprocess.Popen() or subprocess.run() functions, those are used rather than what is inherited from the parent process. We, thus, need to extend the parent process' environment for the command rather than replacing it in its entirety. This commit fixes that.
2025-12-15Update csvcmp to properly handle additions/deletionszsloan
Previously everything was showing up as Modifications
2025-12-09Add http-handler to gunicorn.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2025-12-09Hack: use auth-server-url to check for correct node.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2025-12-09Add description updating code for Batch Editzsloan
2025-11-26Add description updating code for Batch Editzsloan
2025-10-27Improve logging for the asynchronous background tasks.Frederick Muriuki Muriithi
2025-10-27Pass `TEXTDIR` configuration on to the script.Frederick Muriuki Muriithi
Pass the `TEXXDIR` configuration variable on to the script.
2025-10-27Enable logging in `gn3.db.menu` module.Frederick Muriuki Muriithi
2025-10-22typing: Fix type errors.Frederick Muriuki Muriithi
2025-10-22Fetch configs from app setting and pass them downFrederick Muriuki Muriithi
Fix the code to avoid using global variables holding configuration variables to avoid the failures caused by action-at-a-distance effects due to change of a value elsewhere. This way, all code consistently receives the same configuration values passed on from callers. We pass on the following configuration settings: * TMPDIR * SQL_URI * TEXTDIR
2025-10-15Configurations: Use non-executable file for settings.Frederick Muriuki Muriithi
Move configuration from executable .py file into a non-executable .json file. See https://issues.genenetwork.org/issues/genenetwork3/genenetwork3_configuration
2025-09-10Fix pylint failing tests.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2025-08-13Initialise logging formats.Frederick Muriuki Muriithi