-
Notifications
You must be signed in to change notification settings - Fork 26
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
Improve validation error message for missing data type #478
Improve validation error message for missing data type #478
Conversation
* Fix hdmf-dev#284 * Add optional parameter `missing_dt_name` to validation error MissingDataType * Add tests for bug fix
Thanks for the PR, @dsleiter ! Your changes look great. Normally the codecov app leaves a comment with code coverage information for the PR, but for reasons below, that is not being triggered by CI. Here it is for this PR: https://app.codecov.io/gh/hdmf-dev/hdmf/compare/478/diff It's often helpful for us to look at codecov to make sure that the changes are actually tested. The change on line 475 of Just to document a couple meta notes from my Slack discussion with @dsleiter :
|
I'll merge this after the other developers have a chance to look this over in case they would like to. |
Update: it looks like I can edit files in the PR and commit to the branch, so the fix to allow edits from maintainers worked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks for the reviews @rly and @oruebel! Good catch on unreachable code block @rly. I was looking at that last week while working on #197 and trying to understand the validator code, but switched to this task and then forgot to ask. Using coverage diff seems like a much better way to catch this kind of thing. For now, I'll check the coverage diff locally before making the PR. In terms of getting my PRs to trigger the CI jobs, I don't think I can push branches to this repo - I believe I'm a member of the organization, but not the repo. If you'd like to give me write access, then could you please verify the permissions? But this issue is likely to pop up again with other contributors, so it might be better just to build this into the CI pipeline, what do you think? It might just be a matter of adding a manual approval step to the circleci config ( |
Looking deeper into the CircleCI issue, it looks like you could enable "Build forked bull requests" but keep "Pass secrets to builds from forked pull requests" disabled. None of the currently configured jobs that build on a branch/PR seem to require any secrets. I was able to actually to run all jobs on agencyenterprise CircleCI account from a forked PR without configuring any environment variables, and it even pushed coverage directly to our codecov account without configuring any tokens. The only jobs which seem like they would fail are If in the future you wanted to add steps which should not run on forked PRs, you could add a step like In terms of the azure builds, it seemed like they were being triggered properly from a forked PR, although I never checked the details to make sure they actually completed. Do you think we could enable "Build forked bull requests" to give it a test? As an aside, I did notice that when our CirleCI was triggered on
so it wasn't getting the token, but it returned with an exit code of 0, so CircleCI still marked it as success. Maybe this isn't worth spending time fixing since it shouldn't ever run that job on from a forked PR, but there might be other reasons why |
That's how it is currently configured. The CircleCI docs also say:
Can you see if this is the case for you for the next PR that you create?
The way that we have been calling codecov requires passing a private token, at least for Azure and I thought for Circle as well. You can see this log with a codecov upload error from your earlier commit on this PR. We can easily get around that in several ways, and I propose one in #481.
Good point.
Thanks for letting us know! And thanks for looking into these issues and possible solutions in depth. |
re: |
@rly gotcha, I didn't realize it was already configured to build forked PRs. Good catch on the documentation about following the project, seems like that could have been the cause. I unfollowed our fork and started followed hdmf-dev/hdmf, so hopefully it will work on the next PR. For codecov, I did notice in this documentation that at least for the bash uploader, an upload token may not be required: https://app.circleci.com/pipelines/github/agencyenterprise/hdmf
And during my test, it did upload coverage to agencyenterprise codecov without me configuring a token, so maybe it will work (at least from circleci). Let's first get circleci running, and then see if it runs codecov. I also tried to remove |
missing_dt_name
to validation errorMissingDataType
TestNestedTypes
slightly to reduce duplication and facilitate the new testMotivation
Fix #284 by improving the validation error message shown when a missing data type has a name.
How to test the behavior?
Checklist
flake8
from the source directory.