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

All equivalence axioms / logical defs must map to a pattern OR be explicitly approved #2020

Open
cmungall opened this issue Aug 3, 2021 · 18 comments
Assignees

Comments

@cmungall
Copy link
Member

cmungall commented Aug 3, 2021

We need a check

  1. IF there is a logical def (equiv axiom between NC and CE)
  2. AND that does not map to a DP
  3. AND it does not have an annotation on it to the effect of "we know this is a wildcard def"
  4. THEN throw an error

@nicolevasilevsky do we have this in mondo? can we port over?

@matentzn
Copy link
Contributor

matentzn commented Aug 4, 2021

Its hard to do 2 on the fly.. We check these in Mondo after the fact, not at PR time.

Addressing this issue in a computational way is currently not implemented anywhere afaik

@matentzn matentzn self-assigned this Aug 5, 2021
@github-actions
Copy link

github-actions bot commented Feb 2, 2022

This issue has not seen any activity in the past 6 months; it will be closed automatically in one year from now if no action is taken.

@github-actions github-actions bot added the Stale label Feb 2, 2022
@matentzn
Copy link
Contributor

matentzn commented Feb 2, 2022

@cmungall can we use the owl-patterniser on Uberon? Would you be able to support @rays22 to do that (because we want to go that direction anyways not only for Uberon, but in general)?

@github-actions github-actions bot removed the Stale label Feb 3, 2022
@github-actions
Copy link

This issue has not seen any activity in the past 6 months; it will be closed automatically one year from now if no action is taken.

@github-actions github-actions bot added the Stale label Feb 10, 2023
@matentzn
Copy link
Contributor

@anitacaron mention in tech team? Documentation of this could be universally useful..

@github-actions github-actions bot removed the Stale label Feb 11, 2023
@github-actions
Copy link

This issue has not seen any activity in the past 6 months; it will be closed automatically one year from now if no action is taken.

@matentzn
Copy link
Contributor

Mybe aplit the issue:

  1. If the diff touches an intersections_of, require a cjm / davidos review (do this in github action)
  2. The pattern based pattern based validation requires grant money.

@github-actions github-actions bot removed the Stale label Sep 8, 2023
Copy link

github-actions bot commented Mar 7, 2024

This issue has not seen any activity in the past 6 months; it will be closed automatically one year from now if no action is taken.

@github-actions github-actions bot added the Stale label Mar 7, 2024
@matentzn
Copy link
Contributor

@gouttegd here is what I was thinking (roughly)

https://github.com/obophenotype/test-actions/blob/main/.github/workflows/reviewers.yml

However, the last block is bad from a workflow perspective. I would like to post a failing review, but I cant do that in the name of whoever is the responsible person - so I posted one in the name of github actions.

Example PR: obophenotype/test-actions#1

This means, whoever, that GitHub actions will request changes, and someone needs to remember to dismiss that review when they are satisfied. Are we happy with this overhead? A slightly less intrusive way of handling the SOP would be to simply post a comment with a checkbox Reminding folks to NOT MERGE until the reviews of the main reviewer are in (and use this opportunity to even explain WHY the review is needed?)

@gouttegd
Copy link
Collaborator

First, the way you detect changes to logical axioms won’t work. You can’t just check for the presence of intersection_of: tags in the edit file -- this would find all the intersection_of: tags that are present in the edit file (including those that have been there for ages), while what you want is to find the tags that have been added, removed, or modified by the PR.

So what you need to do is to

(1) Look at the diff between the uberon-edit.obo file from the master branch and the uberon-edit.obo file from the PR’s head revision, instead of looking at the uberon-edit.obo file from the PR’s head.

(2) Look for ^(-|\+)intersection_of: lines. You must specifically look for lines starting with a - or a + to avoid detecting the lines that are in the diff just because they are in the context window of the diff, as in this example:

--- a/src/ontology/uberon-edit.obo
+++ b/src/ontology/uberon-edit.obo
@@ -61071,7 +61071,6 @@ xref: FMA:72595
 xref: HBA:265504914
 xref: neuronames:756 {source="BIRNLEX:2638"}
 xref: UMLS:C0262207 {source="BIRNLEX:2638"}
-xref: ZFA:0000518
 intersection_of: UBERON:0035011 ! central gray substance
 intersection_of: part_of UBERON:0001896 ! medulla oblongata
 relationship: part_of UBERON:0001896 {source="FMA"} ! medulla oblongata

Second, regarding what to do when a PR is found to be changing an equivalence axiom:

My concern with your approach is not the fact that the automatic review will have to be dismissed, it’s more that, even after the PR will have been reviewed and approved by a senior editor, it will still appear as having failed one of the CI checks. This does not prevent merging because Uberon (AFAIK) does not enforce that all CI checks must pass before a PR can be merged, but I think it’s a bad idea to get people used to the idea that a failed CI check is not something to worry about.

Why not simply post the failing review, but then allow the CI check to terminate successfully? The failing review in itself is enough to prevent merging, there is no need to end the check on a failure.

@matentzn
Copy link
Contributor

Thanks for feedback.. I forgot to change the grep goal, sorry. Better?

https://github.com/obophenotype/test-actions/blob/main/.github/workflows/reviewers.yml

I tested the diff.txt logic locally now, but weirdly the condition seems not to work in the action itself, see

https://github.com/obophenotype/test-actions/actions/runs/11816392103/job/32919571534

@gouttegd
Copy link
Collaborator

I tested the diff.txt logic locally now, but weirdly the condition seems not to work in the action itself, see

When you ask for git diff uberon-edit.obo from the tip of the PR branch, you won’t see anything, and that’s normal. By default, git diff shows the change in the working copy compared to the HEAD revision. Here (in the context of the GitHub Actions workflow), the working copy has been freshly checked out, so it does not contain any change.

You must compare the tip of the PR branch with the “base” -- the latest commit that is common to the two branches:

git diff master... -- src/ontology/uberon-edit.obo

@gouttegd
Copy link
Collaborator

Actually it would be better to compare with base.ref rather than hard-coding master. github.base_ref is set to point to the base of whichever branch the PR is intended to be merged into (most of the time it would be master, but not always):

git diff ${{ github.base_ref }}... -- src/ontology/uberon-edit.obo

@matentzn
Copy link
Contributor

Works now. If you check one last time, I will make a PR on Uberon with the action for further discussion!

@gouttegd
Copy link
Collaborator

Looks good to me.

I just wonder if it would be possible to:

(1) re-trigger the workflow every time the “review status” of the PR is changed (i.e., when someone approves the PR);
(2) check whether the PR has been approved by a senior editor;
(3) and if so, automatically dismiss the previous “change requested“ review.

But that’s a refinement that can be left for later (assuming it is possible). Better to check with the Uberon editors what they think of the basic idea before making it more complicated. :)

matentzn added a commit that referenced this issue Nov 14, 2024
… are updated

The main use case for this action is to provide a way to assign specific reviewers when equivalent class axioms are added or updated, but it should be easy to extend the action to other kinds of edits, hence the generic name.

To achieve the above, we check the diff for changes to rows that signify a logical definition, i.e. starting with "intersection_of". If we find such a change, we set a special environment variable to "true"; if it is "true", in the next step, a reviewer is assigned. Lastly, we let the GitHub action itself make a review, which requests changes - the idea is that these need to be dismissed by a person which sufficient access to Uberon before the change is committed to the main (master) branch.

Issue: #2020
@matentzn
Copy link
Contributor

Draft here: #3425

@gouttegd
Copy link
Collaborator

It just occurred to me that another improvement to the action could be to use ROBOT to get the diff, rather than git diff. It would be slightly more complicated (we’d need to check out both versions to compare in two directories side by side, so that we can call robot diff on the two versions), but the benefit is that it would work regardless of the edit format. Instead of looking for lines containing intersection_of: (which can only work if the edit file is in the OBO format), we would look for lines containing EquivalentClasses.

It wouldn’t change anything for Uberon, but it would make the action easily “transferable” to other ontologies that use OFN as their edit format (such as CL).

@matentzn
Copy link
Contributor

The added level of generality would come at additional processing cost; right now the action virtually needs no memory, finishes in 15 seconds doesn't need ODK - I would first test this version in Uberon, and maybe refine the strategy later if a need arises?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants