Skip to content

NO TICKET: Coverage and Feature support#83

Merged
jirhiker merged 28 commits into
pre-productionfrom
jir-project-area
Aug 20, 2025
Merged

NO TICKET: Coverage and Feature support#83
jirhiker merged 28 commits into
pre-productionfrom
jir-project-area

Conversation

@jirhiker

@jirhiker jirhiker commented Aug 16, 2025

Copy link
Copy Markdown
Member

Why

This PR addresses the following problem / context:

  • Need full functionality of lexicon editing
  • Groups need project areas
  • Need to transfer contacts to db
  • Need to transfer assets to GCS and db

How

Implementation summary - the following was changed / added / removed:

  • added patch for category and term
  • added user permission dependencies for all endpoints
  • added sorting
  • added get term and category by id
  • added transfer_owners to transfer2.py
  • added transfer_assets to transfer2.py
  • dont use signed_urls for gcs.

Notes

Any special considerations, workarounds, or follow-up work to note?

  • may need to revisit signing of GCS urls.

@codecov-commenter

codecov-commenter commented Aug 18, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.59375% with 42 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
services/gcs_helper.py 76.74% 10 Missing ⚠️
services/validation/geospatial.py 18.18% 9 Missing ⚠️
schemas/group.py 68.00% 8 Missing ⚠️
api/asset.py 83.33% 6 Missing ⚠️
api/lexicon.py 78.94% 4 Missing ⚠️
schemas/location.py 77.77% 2 Missing ⚠️
api/geospatial.py 91.66% 1 Missing ⚠️
api/group.py 85.71% 1 Missing ⚠️
api/thing.py 66.66% 1 Missing ⚠️
Files with missing lines Coverage Δ
core/app.py 66.66% <100.00%> (ø)
db/asset.py 100.00% <100.00%> (ø)
db/base.py 96.07% <ø> (-0.29%) ⬇️
db/contact.py 100.00% <100.00%> (ø)
db/group.py 100.00% <100.00%> (ø)
db/location.py 100.00% <ø> (ø)
db/sensor.py 100.00% <100.00%> (ø)
db/thing.py 100.00% <ø> (+4.65%) ⬆️
schemas/asset.py 100.00% <100.00%> (ø)
schemas/sample.py 98.46% <100.00%> (+0.04%) ⬆️
... and 19 more

@jirhiker jirhiker changed the title jir-project-area NO TICKET: Coverage and Feature support Aug 18, 2025
@jirhiker jirhiker requested a review from jacob-a-brown August 18, 2025 17:19
Comment thread api/asset.py Outdated
Comment thread api/asset.py Outdated
Comment thread api/asset.py Outdated
Comment thread api/geospatial.py Outdated
Comment thread api/group.py Outdated
Comment on lines +59 to +61
group_location_data: CreateGroupThing,
session: session_dependency,
user: admin_dependency,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In my update to the contact router I've named the endpoint /thing-association to clarify what is the contact is being associated with. That could be done here, too.

Also, in our standup today I spoke about how creating an association can be done by defining the group_id in the path or query parameters (in our discussion I talked about the contact router). I decided to go with path parameters (e.g. /group/{group_id}/thing-association), but the group_id can just as well be defined in the payload. Should that be the case here, or should that change in the contact router? Either way, a decision should be made and should be implemented consistently consistent across the API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now that I think about it, though, most POST endpoints let the user-defined parameters be defined in the payload (which group_id and contact_id are)...

Comment thread api/thing.py
Comment thread schemas/group.py
Comment thread schemas/location.py
Comment thread schemas/thing.py Outdated
@jirhiker jirhiker requested a review from jacob-a-brown August 18, 2025 21:43
Comment thread api/group.py Outdated
return adder(session, Group, group_data, user=user)


@router.post(

@jacob-a-brown jacob-a-brown Aug 18, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Updates look good, but what are your thoughts on using /thing-association to be explicit about which table this association references? It may be a moot point here since there's only one association with a group (thing), but if other tables have multiple associations it'd be good to have clear nomenclature and then keep a consistent style throughout the API.

@jacob-a-brown jacob-a-brown Aug 18, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I looked through the database and this is relevant for the author table (AuthorContactAssociation, AuthorPublicationAssociation), so if we decide on a nomenclature now I'll implement it throughout and write it up in the API discussion (which will turn into ADR)

(may also be relevant to others, but this showed up first in my search)

@jacob-a-brown jacob-a-brown left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Per our discussion today, comment out the /association endpoints. We may not want users to directly interact with these tables; that will be determined in conversations with AMP.

Should the responses have lists of the associations, at least their IDs? So GroupResponse could also have

associations: dict[str, List[int]]

e.g.

associations: {"thing": [1, 2, 3]}

if that group is associated with things 1, 2, and 3. This allows multiple associations to exist and be returned (like the authors)

Or keep the GET endpoints (and name their associations, like /group/thing-association

@jacob-a-brown

Copy link
Copy Markdown
Contributor

Another thought...

proceed with commenting out all /association references and leave them be so that we can get this PR merged and the PR with the contact coverage updated merged. Then on Thursday when we convene for the WDI dev team rendezvous we discuss/come to a consensus on how we want to handle associations (in the responses for the objects, by themselves, or something else altogether)

@jirhiker jirhiker requested a review from jacob-a-brown August 20, 2025 06:03
@jirhiker jirhiker merged commit 585259a into pre-production Aug 20, 2025
3 checks passed
@jirhiker jirhiker deleted the jir-project-area branch September 24, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants