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

Fix markdown typos #1285

Merged
merged 1 commit into from
Dec 3, 2023
Merged

Fix markdown typos #1285

merged 1 commit into from
Dec 3, 2023

Conversation

janosh
Copy link
Contributor

@janosh janosh commented Dec 3, 2023

Follow up to #1283.

@janosh
Copy link
Contributor Author

janosh commented Dec 3, 2023

run jenkins

@Andrew-S-Rosen
Copy link
Member

Andrew-S-Rosen commented Dec 3, 2023

@janosh: It works!!! Thank you! I just have to work on getting the build logs public, but this solves it. And thanks for your markdown fixes :)

image
image

Note to self: We have to rely on a whitelist to ensure people don't run arbitrary, unseen code on the cluster. I manually added @janosh to the whitelist and anyone in @Quantum-Accelerators. However, for everyone else, we have the bot post a message that has to be approved by a maintainer ("ok to test"), after which the trigger phrase can be used.

@Andrew-S-Rosen Andrew-S-Rosen merged commit 6abe621 into Quantum-Accelerators:main Dec 3, 2023
@janosh janosh deleted the fix-md-typos branch December 3, 2023 03:02
@janosh
Copy link
Contributor Author

janosh commented Dec 3, 2023

@Andrew-S-Rosen You could also use something like what GitHub uses to determine whether CI is allowed to run on a PR. It checks if "author_association" == "FIRST_TIME_CONTRIBUTOR" and if so waits for a maintainer to explicitly give CI approval.

Might save you the hassle of maintaining a white list.

import requests

def is_first_time_contributor(owner, repo, pr_number, access_token):
    headers = {
        "Authorization": f"token {access_token}",
        "Accept": "application/vnd.github.v3+json"
    }
    url = f"https://api.github.com/repos/{owner}/{repo}/pulls/{pr_number}"

    response = requests.get(url, headers=headers)
    if response.status_code == 200:
        pr_info = response.json()
        return pr_info.get("author_association") == "FIRST_TIME_CONTRIBUTOR"
    else:
        raise Exception(f"GitHub API error: {response.status_code}")

@Andrew-S-Rosen
Copy link
Member

Andrew-S-Rosen commented Dec 3, 2023

@janosh: Thanks! That's good to know.

The are reasons related to security that it's important to strictly maintain a whitelist. Even if a PR looks safe, someone can then follow it up with a malicious commit once given approval. Still sorting out the logistics of how I want to handle this, but your PRs helped me figure out a few of the logistics on the backend.

Either way, the regular test suite always runs on PRs like normal.

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

Successfully merging this pull request may close these issues.

2 participants