| Age | Commit message (Collapse) | Author |
|
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>
|
|
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>
|
|
|
|
Add a root endpoint for the GN3 system. Use the HATEOAS paradigm (or
adjacent) to help with discovery of the API.
|
|
Update the two call-sites (metadata.py and case_attributes.py) to use
the non-deprecated endpoint path.
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
This commit fixes the values for the "name" and "fullName" fields,
which, prior to this commit, seem to have been swapped.
|
|
|
|
Update the `can_edit` import after changes to upstream `gn-libs` library.
|
|
* 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.
|
|
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
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.
|
|
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
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
|
|
limiting.
|
|
|
|
|
|
This reverts commit f5e89525f941caa6546ea777bb632b7aa44f9b1f.
|
|
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
To update an attribute, you can use the "apply_change" function
instead.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|