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 check for GitHub "obofoundry" tag for new ontologies #1535

Closed
cthoyt opened this issue Jun 7, 2021 · 9 comments
Closed

Add check for GitHub "obofoundry" tag for new ontologies #1535

cthoyt opened this issue Jun 7, 2021 · 9 comments
Labels
principles Issues related to Foundry principles

Comments

@cthoyt
Copy link
Collaborator

cthoyt commented Jun 7, 2021

After the successful launch of the GitHub topic page for the OBO Foundry motivated by #1493, it would make sense to ask all new ontologies tag themselves with obofoundry.

I think it's also worth considering how we should communicate that the obofoundry tag isn't an endorsement from the OBO Foundry the same way that getting accepted is. It's the case that anyone can add the tag on GitHub and it may also be meaningful to add other types of resources like software packages (e.g., I added the obofoundry topic to the PyOBO Python software package)

Code example

The following function in Python could be used to check for a repo if it has a given topic.

from typing import Optional

import requests


def has_topic(owner: str, repo: str, topic: str, token: Optional[str] = None) -> bool:
    """Check if the given GitHub repository has the given topic.

    :param owner: The name of the owner/organization for the repository.
    :param repo: The name of the repository.
    :param topic: The topic to check if the repository has. Case and punctuation sensitive.
    :param token: The GitHub OAuth token. Not required, but if given, will let
        you make many more queries before getting rate limited.
    :return: If the repository has the given topic.
    """
    headers = {
        'Accept': "application/vnd.github.mercy-preview+json",
    }
    if token:
        headers['Authorization'] = f"token {token}",

    res = requests.get(
        f'https://api.github.com/repos/{owner}/{repo}/topics',
        headers=headers,
    )
    res_json = res.json()
    return topic in res_json['names']

Example usage:

assert has_topic('obophenotype', 'dicty-phenotype-ontology', topic='obofoundry'))
assert not has_topic('pytorch', 'pytorch', topic='obofoundry'))

See Also

@cthoyt cthoyt changed the title Add check for GitHub "obofoundry Add check for GitHub "obofoundry" tag for new ontologies Jun 7, 2021
@nlharris
Copy link
Contributor

nlharris commented Jun 7, 2021

@matentzn i was a bit surprised to see that there's not a label 'dashboard' -- should i create one?

@nlharris
Copy link
Contributor

nlharris commented Jun 7, 2021

More about this ticket (from Slack): Charlie wrote:

any repo tagged with “obofoundry” as a topic will get listed on this page: https://github.com/topics/obofoundry
If you haven’t tagged your repositories before, you can follow GitHub’s excellent tutorial to get yours listed here too https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/classifying-your-repository-with-topics

@balhoff
Copy link
Contributor

balhoff commented Jun 7, 2021

@cthoyt @nlharris there is a dashboard repo: https://github.com/OBOFoundry/OBO-Dashboard

Should we transfer this issue there?

@nlharris
Copy link
Contributor

nlharris commented Jun 8, 2021

Maybe? It's up to @matentzn

BTW, this issue is related to #1538

@nlharris nlharris added the principles Issues related to Foundry principles label Jun 8, 2021
@matentzn
Copy link
Contributor

matentzn commented Jun 9, 2021

The issue needs to be discussed at obo foundry operations committee level. Can someone add the tag please so we discuss, then I will move it.

@jamesaoverton
Copy link
Member

I think it's a good idea to consistently use the "obofoundry" GitHub tag, and we might as well add an automated check like this and track when the tag is and is not used.

But using GitHub is not an OBO requirement and so this cannot be a requirement. We require version control and a public issue tracker, and currently 90% of active projects happen to use GitHub, that's all.

@matentzn
Copy link
Contributor

Yes I agree with @jamesaoverton - this is not a matter for the dashboard - I love the tag, but same as slack, this needs to be dealt with in a "social" manner through people looking out and talking, not through a QC check.

@nlharris
Copy link
Contributor

We discussed this briefly during an OFOC call and agreed that this should be recommended but not formally required for new ontologies. Thanks for suggesting it, though!

@matentzn
Copy link
Contributor

Best practices collected here:

#1579

Will use this to compile a page for the site once its done which will be circulated to new and old developers.

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

No branches or pull requests

5 participants