Skip to content

[#1017] updating missing_label query to support empty labels #1018

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

Merged
merged 9 commits into from
Jul 28, 2022

Conversation

psiotwo
Copy link
Contributor

@psiotwo psiotwo commented Jun 25, 2022

Resolves [#1017]

  • [ x ] docs/ have been added/updated
  • [ x ] tests have been added/updated
  • [ x ] mvn verify says all tests pass
  • [ x ] mvn site says all JavaDocs correct
  • [ x ] CHANGELOG.md has been updated

Added a condition checking for empty labels (also across languages) "" into the missing_label.rq.

The test code added is more general than needed to allow adding other query tests easily.

I did some ad-hoc performance tests just on my Mac on DOID, EFO and HP - all showing up to 10% performance degradation with the new query.

@matentzn if you have a more representative benchmark to push it through, would be great!

Copy link
Contributor

@matentzn matentzn left a comment

Choose a reason for hiding this comment

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

@psiotwo looks great! One (apart from the individual comment):

Is every single change you make here absolutely necessary for the PR? This is a very important criterion for us now, because of the cost of accidentally introducing non obvious bugs.

Thank you for your contribution!

**OBO Foundry Principle:** [12 - Naming Conventions](http://www.obofoundry.org/principles/fp-012-naming-conventions.html)

**Solution:** Add a label.
# # Missing Label
Copy link
Contributor

Choose a reason for hiding this comment

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

Introduction of redundant # for the MD file!

Copy link
Member

Choose a reason for hiding this comment

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

Yes. Better to use the https://github.com/ontodev/robot/blob/master/docs/Makefile to generate the doc from the query file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, actually deleting docs/report_queries/missing_label.md and (naively) running make inside docs does generate these # in the MD file ... if I didn't miss any config, the only thing that jumps into my mind now is that some sed regex might behave differently on various platforms (I am using M1 Mac) ... but not sure, will take a look later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have just manually removed the #s at present.

for (String qPath : queryFilePaths) {
String ruleName = qPath.substring(qPath.lastIndexOf("/")).split(".")[0];
for (final Path qPath : queryFilePaths) {
final String ruleName = qPath.getFileName().toString().split("[.]")[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

These kinds of changes are very hard to review and we prefer in the interest of resources to only do them if we have an issue that cleary explains what is wrong, with agreement all around it absolutely needs changing and then changing it. Are they absolutely essential to this PR?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @matentzn for asking to keep the PR focused, and sorry if I’m being inconsistent, but this path handling looks like a nice improvement.

Copy link
Contributor Author

@psiotwo psiotwo Jun 25, 2022

Choose a reason for hiding this comment

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

@matentzn you are absolutely right. Actually, I originally wanted to "hang" the test on the existing API of ReportOperation - these changes were needed to make the profile file processing actually working from tests.

But this would have meant going through profile.txt which would be an extra overhead so I reconsidered and used the getViolations method to keep it focused. This bit of code belonged to the original story and I accidentally committed it.

Now I reverted it back. I also don't like these types of extra changes - doing unnecessary changes when there are almost no tests around is dangerous.

Copy link
Member

@jamesaoverton jamesaoverton left a comment

Choose a reason for hiding this comment

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

Sorry for the long delay. The code looks good, and the detailed test is much appreciated! The performance hit you're reporting is more than I would like, but I feel that this is an important case to cover. Thanks again!

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