opensafely-core / interactive.opensafely.org

Point-and-click analysis of NHS electronic health records
https://interactive.opensafely.org
Other
2 stars 0 forks source link

SPIKE Investigate moving analysis code into Reusable Actions #465

Closed lucyb closed 1 year ago

lucyb commented 1 year ago

Integrating OSIv2 into Job Server would be made easier if the code was stored externally in one or more repos. Conveniently, Reusable Actions provides this option, as well as allowing others to benefit from the work we've done.

This ticket covers the investigation to look at what Interactive actions would be useful as Reusable Actions.

Acceptance Criteria:

LFISHER7 commented 1 year ago

The post cohort extraction analysis pipeline contains the following steps (example project.yaml here):

To be appropriate for conversion to a reusable actions, these should be able to be split into logical units of code (they already are) and these units should solve a problem that occurs in multiple studies. I've outline below whether I think that is true for each step.

bloodearnest commented 1 year ago

To be appropriate for conversion to a reusable actions ... these units should solve a problem that occurs in multiple studies.

I don't think this is quite correct.

That's what the idea is for community contributed "reusable actions", yes.

We have a generic mechanism in project.yaml/job-runner to allow action code to be defined outside the project. Technically, that's all "reusable actions" are (modulo some details).

The policies we have around what an "reusable action" should be, and who should be able to write to one, is specifically about this idea of shared community maintained code.

Our use case for the more generic concept of "external actions" is not about reusablity, but security and isolation.

Under the hood, they would use the same syntax and mechanism as "reusable actions", but the policy about them would be very different. For example, I don't see any reason why the shouldn't just live in the opensafely-core repo, as I would expect only Bennett staff to write to them.

So, I think it is completely fine for us to have specific, one use code in an external action code base for the purposes of an OSI action. It shouldn't be in the opensafely-actions org, as it's not intended to be reused, at least initially.

lucyb commented 1 year ago

I'm going to close this SPIKE for now thanks to Louis's comprehensive investigation. We're going to put the analysis/report code into a separate repo within the opensafely-core organisation. This will allow people to contribute to the code without having to get a job-server development environment working, which was the original reason for asking the question, but also allow us to move towards reusable actions where appropriate in future.