Skip to content

Error parsing user metadata #70

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

Closed
SimonMolinsky opened this issue Oct 15, 2023 · 5 comments
Closed

Error parsing user metadata #70

SimonMolinsky opened this issue Oct 15, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@SimonMolinsky
Copy link
Contributor

Problem

There is a problem with parsing contributors' metadata in package reviews. The problem is probably related to this line of the code:

    def _get_line_meta(self, line_item: list[str]) -> dict[str, object]:
        ...
        if self._contains_keyword(line_item[0]):
            if line_item[0].startswith("All current maintainers"):
                ...
            else:
                names = line_item[1].split("(", 1)  # THIS LINE HERE!
               ...
        return meta

It probably leads to the parsing error here: https://github.com/pyOpenSci/pyopensci.github.io/actions/runs/6521128026/job/17709405005

Reason

I think splitting the line by round bracket ) is why the error occurs. One reviewer's name here: pyOpenSci/software-submission#115 has this character.

Solution

There are two options:

  1. Restrict characters in names (update Editors Guide),
  2. Change the parsing method to detect the @ character.

I can do both, so you can assign me to this issue 🚀

@cmarmo
Copy link
Member

cmarmo commented Oct 15, 2023

@SimonMolinsky I'm having the same issue when updating the website for astartes. It would be wonderful if you can fix it!
As far as I'm concerned I'd rather have the @ detected.

@lwasser
Copy link
Member

lwasser commented Oct 15, 2023

@SimonMolinsky if you can work on this i'd greatly appreciate it!! i must have broken the build with a recent update!! i'll assign you now.

@lwasser lwasser added the bug Something isn't working label Oct 15, 2023
@lwasser
Copy link
Member

lwasser commented Oct 15, 2023

also agree with @cmarmo on - let's parse for the @. i haven't look at that code in a bit of time but i DO recall i used the ghusername as a unique identifier in the dictionaries (i'm pretty sure each dict contains a pydantic "personmodel" that i created and validates accordingly. But it is the case that sometimes in our issues, people add their names in ways that i didn't expect. then it breaks the build.

i'm wondering if that is the case here. but regardless appreciate your looking into this - thank you!!

@SimonMolinsky
Copy link
Contributor Author

SimonMolinsky commented Oct 16, 2023

@lwasser It was relatively easy to dive into your code. It is self-explanatory. I will work on it then. Thanks for the assignment!

@cmarmo I will check your case too :)

@lwasser
Copy link
Member

lwasser commented Oct 22, 2023

ok this has been merged!! thank you BOTH for being invested in fixing this. i'm going to see if the new packages add to our site now. And then followup with a small cleanup fix so there is no markdown in package names!!

i'm relieved to hear the code here was not too bad to navigate! i have a tendency to over complicate workflows altho i can say pydantic helped me really clean things up here!!!

@lwasser lwasser closed this as completed Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants