Skip to main content

Comparing study code on OpenSAFELY Jobs

28 February 2024

OpenSAFELY Jobs has always shown the Git commit hash for a given job request or job, with a link to view the workspace’s code on GitHub as of that revision. We now also provide GitHub code comparison links (example) so you can see exactly what code has changed between this revision and previous versions.

Job Requests

The code comparison links can be found on a job request’s page in the Code comparison section beneath the job information. If this is the first job request for this workspace on this backend, no code comparison is possible and so no link is available. If there are previous job requests, a link to compare the workspace’s code for this job request to the previous, and previous successful runs (if present) will be present.

Jobs

The code comparison links can be found on a job’s page at the bottom of the Job information section. If this is the first run of this action in this workspace on this backend, no code comparison is possible. If it has been run before, links to compare the workspace’s code for this job to the previous, and previous successful runs (if present) will be present.

N.B. If there lots of changes between versions of a workspace’s codebase, the code comparisons for a job may also include changes that are not directly related to the job in question. Identification of the job by its action name in the project.yaml file and examination of changes to related files listed in its configuration should reveal what the relevant changes are.