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

Add "registry checks" section to the website #271

Merged
merged 3 commits into from
Sep 17, 2023
Merged

Conversation

AhmedBasem20
Copy link
Collaborator

@AhmedBasem20 AhmedBasem20 commented Sep 13, 2023

Closes #268
Store fetch warnings in the JSON file and display it on the details page.

Edit:

The current PR preview workflow preview.yml gets the data from gh-pages and builds the react app using it, this works fine for most of the cases because the preview purpose is to show the UI so I thought using up-to-date data was not important, but for a scenario like in this PR, where we add new data to the JSON file and use it for the first time on the website, the preview will not display the new feature.

This is solved in the second commit by using the data fetched in this PR.

@github-actions
Copy link

github-actions bot commented Sep 13, 2023

PR Preview Action v1.4.4
Preview removed because the pull request was closed.
2023-09-17 14:10 UTC

@AhmedBasem20 AhmedBasem20 force-pushed the display-warnings branch 2 times, most recently from 67d4d4e to 840681e Compare September 13, 2023 16:51
@ltalirz
Copy link
Member

ltalirz commented Sep 13, 2023

Thanks a lot @AhmedBasem20 , this is great!

I have some minor requests

  • Since you are now using the warning style, you can remove the textual > WARNING! prefix (and I don't mean to strip it off, but to never add it in the first place)
  • Please delete the comment.yml workflow, it is no longer needed

The final question is whether we want to keep the warnings as high up in the detail page as we currently do. Currently those warnings are not targeting users but rather the developers of the package, so perhaps they are not as important and could be moved to a top-level section at the end of the page.
On the other hand, having the warnings high up in the page may make it more likely for plugin developers to fix them.

  • I would say let's keep them there for the moment, but let's rename the section title to "Registry checks"

After these minor edits, this is good to merge for me

@AhmedBasem20
Copy link
Collaborator Author

Thanks @ltalirz ,

Please delete the comment.yml workflow, it is no longer needed

I think this will still be needed because the PR preview currently doesn't support deploying from forks.
This will be supported in the upcoming release of https://github.com/rossjrw/pr-preview-action , we should keep it until then, right?

@ltalirz
Copy link
Member

ltalirz commented Sep 14, 2023

Thanks @ltalirz ,

Please delete the comment.yml workflow, it is no longer needed

I think this will still be needed because the PR preview currently doesn't support deploying from forks. This will be supported in the upcoming release of https://github.com/rossjrw/pr-preview-action , we should keep it until then, right?

You make a very good point there that I had not considered, but I think plugin developers have not actually looked at these warnings (also, for some reason they don't actually show up in the places where they should; e.g. if you look at #238 it does not have this comment; mostly I receive those via email for every new pull request and they have been more annoying than useful).

I think it is ok that for the moment I will still manually have a look at the output of the fetch step in the github action workflow when someone adds a new plugin (let's be sure that the warnings are still printed there).
And let's open an issue to upgrade the pr preview action once the new release is available.

Copy link
Member

@ltalirz ltalirz left a comment

Choose a reason for hiding this comment

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

thanks a lot @AhmedBasem20 !

I will update the email now

@AhmedBasem20
Copy link
Collaborator Author

Very nice @ltalirz , I opened the issue at #272

@@ -105,6 +106,15 @@ function Details({pluginKey}) {
</p>
)}

{value.warnings && (
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, while writing the email I realized one more small request.

If there are no warnings, can we just show a "sucess"-style message "All checks passed"?

Many plugins pass all checks, so developers would be looking for this section and not finding it

Copy link
Member

@ltalirz ltalirz Sep 14, 2023

Choose a reason for hiding this comment

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

Are there cases where warnings will be empty for a reason other than everything being fine (some error encountered, so the code does not get to the stage of adding warnings)?

If so, we may need to track in the json somewhere whether the fetch stage was completed for the plugin

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If there are no warnings, can we just show a "sucess"-style message "All checks passed"?

Done.

Are there cases where warnings will be empty for a reason other than everything being fine (some error encountered, so the code does not get to the stage of adding warnings)?

Yes this is the case for aiida-fenics for example, the plugin link is broken, but even if the warnings is empty it will not display "All checks passed" because this depends on another condition that the detailed infomration must be fetched first. If not, nothing will be displayed.

Copy link
Collaborator Author

@AhmedBasem20 AhmedBasem20 Sep 14, 2023

Choose a reason for hiding this comment

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

Thanks @ltalirz I got your point now, I think there is another issue, putting the registry checks on this section will not work for plugins that have empty metadata key. I'll try to fix this

@unkcpz
Copy link
Member

unkcpz commented Sep 14, 2023

Thanks, both, I didn't look at the implementation. But the behavior is a bit strange to me. When I go to the detail page of aiida-catmat which don't have check mark on the index page. It has this "All checks passed!" on the detail page. Which plugin has the warning showing, I just cannot see the feature was supposed to add.

@ltalirz
Copy link
Member

ltalirz commented Sep 14, 2023

Thanks, both, I didn't look at the implementation. But the behavior is a bit strange to me. When I go to the detail page of aiida-catmat which don't have check mark on the index page. It has this "All checks passed!" on the detail page. Which plugin has the warning showing, I just cannot see the feature was supposed to add.

Yes, ideally the test-install workflow would also add a warning in the checks pointing out that it failed (the equivalent of a missing checkmark)

@ltalirz
Copy link
Member

ltalirz commented Sep 15, 2023

Thanks, both, I didn't look at the implementation. But the behavior is a bit strange to me. When I go to the detail page of aiida-catmat which don't have check mark on the index page. It has this "All checks passed!" on the detail page. Which plugin has the warning showing, I just cannot see the feature was supposed to add.

Yes, there seems to be a bug in the current preview.
E.g. aiida-alloy should have warnings

WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-aenet]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-alloy]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-alloy]
WARNING! Entry point 'elastic' does not start with prefix 'alloy.' [aiida-alloy]

Store fetch warnings in the JSON file and display it on the website.
Delete comment.yml
@AhmedBasem20 AhmedBasem20 force-pushed the display-warnings branch 4 times, most recently from d1ff265 to f2cbc5c Compare September 16, 2023 11:22
plugins_warnings = REPORTER.plugins_warnings

for name, warnings in plugins_warnings.items():
metadata["plugins"][name]["warnings"] = warnings
Copy link
Member

Choose a reason for hiding this comment

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

Hi @AhmedBasem20, the page build is successful but there's a problem here that the warnings are generated in two steps and test install warning will override the previous warnings. You can append the new message is it was there already.

Copy link
Member

@unkcpz unkcpz Sep 16, 2023

Choose a reason for hiding this comment

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

BTW, I can run aiida-registry test-install on my Apple M1 Macbook, and use the new docker image which has arm64 supported.

# install colima
brew install colima
# Use new docker sock, the python docker API is use DOCKER_HOST to find the docker.sock
echo 'export DOCKER_HOST="unix://$HOME/.colima/default/docker.sock"' >> ~/.zprofile
# cd into the folder and run 
aiida-registry test-install --container-image aiidateam/aiida-core-with-services:edge

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

BTW, I can run aiida-registry test-install on my Apple M1 Macbook, and use the new docker image which has arm64 supported.

This is exactly what I need for this task😅 Thanks for the reminder!

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I know, I also try to reproduce it and find it takes so long to see what happened. It is nearly impossible to debug over action output 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the warnings are generated in two steps and test install warning will override the previous warnings.

Yeah I see, also this function is called inside a loop it should only called once in the last step, I also see that the previous warnings coming from fetch_metadata.py cannot be accessed and seen here, I'll try to figure out why.

Copy link
Collaborator Author

@AhmedBasem20 AhmedBasem20 Sep 16, 2023

Choose a reason for hiding this comment

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

Also I see that those test-install messages are actually errors not warnings, should we keep them with warnings or separate them? (i.e. plugin["warnings"], plugin["errors"])

Copy link
Member

Choose a reason for hiding this comment

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

The "permission denied" error we saw yesterday was because the UID of my workstation is 1001 while the container has 1000 as default, so the file can not be written to the folder. I added the write permission and it is all good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I know, I also try to reproduce it and find it takes so long to see what happened. It is nearly impossible to debug over action output 😄

I have a very naive way on debugging over github actions by breaking the test-install loop after five plugins for example (https://ahmedbasem20.github.io/aiida-registry/aiida-alloy). This is temporarily faster but I'll defiantly try to set the environment properly.

@AhmedBasem20 AhmedBasem20 force-pushed the display-warnings branch 2 times, most recently from 573bd49 to 666e603 Compare September 16, 2023 22:37
Copy link
Member

@ltalirz ltalirz left a comment

Choose a reason for hiding this comment

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

fantastic, this looks great!

I am approving this - I notice one small issue namely that there are no line breaks in the error message; if that's easy to fix please do so, but if not, no problem

image

@ltalirz ltalirz mentioned this pull request Sep 17, 2023
3 tasks
@ltalirz ltalirz changed the title Add fetch warnings section to the website Add "registry checks" section to the website Sep 17, 2023
@ltalirz
Copy link
Member

ltalirz commented Sep 17, 2023

Great, thanks @AhmedBasem20

I am merging this now; I notice one further small potential for improvement, which is to add a warning in the test-install workflow when we skip testing the plugin (e.g. because of mismatch in python version / planning stage / ...).
E.g. for this one https://aiidateam.github.io/aiida-registry/pr-preview/pr-271/aiida-aenet

But let's do that small fix in a follow-up PR

@ltalirz ltalirz merged commit f182c30 into master Sep 17, 2023
9 checks passed
@ltalirz ltalirz deleted the display-warnings branch September 17, 2023 13:37
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.

display fetch warnings in registry
3 participants