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

CI: Add GitHub Action to append installation instructions to PRs #2337

Closed
wants to merge 2 commits into from

Conversation

EwoutH
Copy link
Member

@EwoutH EwoutH commented Oct 3, 2024

This PR adds a simple workflow that adds the installation instructions to each PR. It helps contributors, testers and reviews quickly get an installation command to test a PR, especially if they want to install it to use with other packages such as Mesa examples.

For example, for this PR the following message would be added:

You can install this PR branch with:

pip install -U -e git+https://github.com/EwoutH/mesa@pr_message#egg=mesa

This commit introduces a new GitHub Actions workflow that automatically
appends installation instructions to newly opened pull requests. The
workflow does the following:

- Triggers on the 'pull_request' event, specifically when a PR is opened
- Uses the GitHub CLI to fetch PR details (body, fork name, branch name)
- Determines the correct repository owner (projectmesa or fork owner)
- Constructs an installation note with the appropriate pip install command
- Appends the installation note to the end of the PR description
- Updates the PR with the new description

This addition will make it easier for reviewers and other contributors
to test PRs by providing clear instructions on how to install the PR
branch. It works for both PRs from the main repository and from forks.

The installation note format is:

You can install this PR branch with:
```
pip install -U -e git+https://github.com/${REPO_OWNER}/mesa@${PR_BRANCH}#egg=mesa
```

Where ${REPO_OWNER} is either 'projectmesa' or the fork owner's name,
and ${PR_BRANCH} is the name of the branch associated with the PR.
@EwoutH EwoutH added ci Release notes label maintenance Release notes label labels Oct 3, 2024
@EwoutH EwoutH marked this pull request as ready for review October 3, 2024 12:07
@rht
Copy link
Contributor

rht commented Oct 3, 2024

I'd say that a new message instead of an amend is less intrusive (the bot is editing people's PR message body without their consent here).

@EwoutH
Copy link
Member Author

EwoutH commented Oct 3, 2024

I see your argument but:

  • You're opening a PR to our repo. We will add labels, milestones and sometimes edit your PR message, title or even code directly. How is this different?
  • You can always modify or delete it.

@rht
Copy link
Contributor

rht commented Oct 4, 2024

How is this different?

Contributor can opt to make their PR commits non-editable. Does this auto-edit does the edit bypassing this condition?

At the very least, needs to make it clear with a header that it is edited by a GH Actions bot.

@EwoutH
Copy link
Member Author

EwoutH commented Oct 10, 2024

Doesn’t feel worth it pushing this, maybe too niche.

@EwoutH EwoutH closed this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Release notes label maintenance Release notes label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants