Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement file approval backend #174

Merged
merged 16 commits into from
Mar 22, 2024
Merged

Conversation

madwort
Copy link
Contributor

@madwort madwort commented Mar 15, 2024

as per #137

@madwort madwort changed the title Madwort/implement file approval backend Implement file approval backend Mar 15, 2024
@madwort madwort force-pushed the madwort/implement-file-approval-backend branch 7 times, most recently from f6ef1d5 to b97caae Compare March 15, 2024 17:09
@madwort madwort marked this pull request as ready for review March 15, 2024 17:10
Copy link
Member

@bloodearnest bloodearnest left a comment

Choose a reason for hiding this comment

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

Look good, all the right pieces in place.

Left a few comments.

However, I am not a fan of get_file_approvals design in the ticket, and deserialisation between the DAL and the BLL.

From my comment there:

I would much prefer it if business_logic.RequestFile grew an
.approvals attr, which is a list of the new
business_logic.FileApproval objects for that file. And that when
get_release_request will build up the full tree of objects via its
existing from_dict mechanism, and we can just iterate the one
object, rather than integrating two data sources.

When we call bll.get_release_request(...), we want to get back a single object representation of everything, like so:

ReleaseRequest
  .filegroups[]
     .files[]
         .reviews[]

Rather than having to call .get_release_request and also then .get_file_approvals and pass both into wherever they are used, its all in the one object tree.

I cannot think of a use case for getting the approvals alone, when we don't also need everything else, but maybe I've missed that?

I think if we do this, it should solve a few issues with this PR atm:

  • removes the need for the circular FileReview.release_request reference
  • makes the from_dict implementation simpler.

airlock/business_logic.py Outdated Show resolved Hide resolved
local_db/data_access.py Outdated Show resolved Hide resolved
airlock/business_logic.py Outdated Show resolved Hide resolved
local_db/data_access.py Outdated Show resolved Hide resolved
airlock/business_logic.py Outdated Show resolved Hide resolved
local_db/data_access.py Outdated Show resolved Hide resolved
@rebkwok rebkwok force-pushed the madwort/implement-file-approval-backend branch from b97caae to 7c972e0 Compare March 19, 2024 10:29
@madwort madwort force-pushed the madwort/implement-file-approval-backend branch 6 times, most recently from 67b276c to df04eb6 Compare March 21, 2024 14:51
madwort and others added 11 commits March 21, 2024 14:56
* because we are only unit testing the BLL and not the DAL currently,
  these handlers cause test coverage to dip from 100% to 99.88%.
is_supporting_file identifies whether a file is a supporting file
from a UrlPath. This is different to a ReleaseFile's relpath (it
includes the filegroup, which is part of the url for a release file,
but is not part of the relpath, which comes from its location in the
workspace).
@madwort madwort force-pushed the madwort/implement-file-approval-backend branch from e767c54 to 33034dc Compare March 21, 2024 14:56
@madwort
Copy link
Contributor Author

madwort commented Mar 21, 2024

I cannot think of a use case for getting the approvals alone, when we don't also need everything else, but maybe I've missed that?

I started on this path because I wanted exactly that for the unit tests & then decided to proceed with the implementation in the original ticket. Having looked at it again, though, I think you're absolutely right so have re-worked this in the way that you suggest.

@madwort madwort force-pushed the madwort/implement-file-approval-backend branch from a034fd0 to 86eaf67 Compare March 21, 2024 15:03
Copy link
Member

@bloodearnest bloodearnest left a comment

Choose a reason for hiding this comment

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

This is nice, thanks for reworking those bits. I think its worked out as I'd hoped 🙏

Left a couple of suggestions, but happy to land this!

airlock/business_logic.py Show resolved Hide resolved
airlock/business_logic.py Outdated Show resolved Hide resolved
@madwort madwort enabled auto-merge (rebase) March 22, 2024 09:57
@madwort madwort disabled auto-merge March 22, 2024 09:58
@madwort madwort force-pushed the madwort/implement-file-approval-backend branch from a5f1552 to 841f2a9 Compare March 22, 2024 09:59
@madwort madwort merged commit c422602 into main Mar 22, 2024
8 checks passed
@madwort madwort deleted the madwort/implement-file-approval-backend branch March 22, 2024 10:02
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