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

[Feature Request] Support for custom templating for "/describe" #213

Closed
KalleV opened this issue Aug 16, 2023 · 6 comments
Closed

[Feature Request] Support for custom templating for "/describe" #213

KalleV opened this issue Aug 16, 2023 · 6 comments
Labels

Comments

@KalleV
Copy link

KalleV commented Aug 16, 2023

I've been running the "/describe" on a lot of PRs, and the output is excellent. With reviews automatically being created by the PR Agent, this one has been my primary shortcut. One usability issue I'm running into, however, is that the "/describe" replaces the entire PR description section and title.

The "/describe -c" option for posting the description as a comment works as expected, but what I'd really like to do is automate the process of manually filling out Github pull request templates.

For a possible implementation, it seems like trying to automatically map the LLM response to a dynamically configured pull request template would have too many edge cases. Instead, what if there was support for short-code or variable expansion mechanisms such as: pr_agent:describe, and then the AI could substitute the variable with the description?

@tjwp
Copy link
Contributor

tjwp commented Aug 16, 2023

Yes! I've been thinking about similar things. Many of our repos include a .github/PULL_REQUEST_TEMPLATE.md. I was thinking about experimenting with a separate command/prompt that would pull that template for a repo (if it exists) and attempt to generate a description based on that format.

The short-code expansion is also interesting. This is similar to the "markers" that Copilot for Pull Requests uses.

@ShaiGilboa
Copy link

agreed! this will be great!
for example, we always put a link to the related ticket in the PR description, but the /describe is removing it 😅

@ShaiGilboa
Copy link

I will also add an option to template the title of the PR, again, we always add the related ticket number to the PR title, and the /describe removes it

@mrT23
Copy link
Collaborator

mrT23 commented Aug 17, 2023

You are welcome to open a PR for the 'describe' tool with the option to set a dedicated title, or add a dedicated extra section:

Something like:
/describe --pr_description.title="..." --pr_description.extra_section="..."
p.s. try also the "extra_instructions" that already exist, it might be able to address some of the needs.

@tjwp regarding your suggestion about reading and using a dedicated template, it is more complicated to get this kind of thing to work reliably. Templates can be large and complicated, and it also make it harder to use of a custom json. you are welcome to try and share a tool. Look at the 'update_changelog' tool for inspiration, it does something similar (reads the current changelog file, and uses its current style to update the changelog)

@Varun-Mullins
Copy link

I spotted a possible problem with the /describe -c feature for the generated PR description. I had some screenshots in my PR descriptions before adding the /describe -c. But it seems to have replaced the screenshots with the generated description. Don't know if that's a bug or if that was intended.
Thanks!

@KalleV
Copy link
Author

KalleV commented Aug 28, 2023

I'm not sure when it was added but I found the "pr_description.add_original_user_description" and "pr_description.keep_original_user_title" PR agent config options and it's helping a lot with this issue.

Example:

/describe --pr_description.add_original_user_description=true --pr_description.keep_original_user_title=true

Github Action version (defaulting "add_original_user_description" as true for repo using /describe):

env:
  PR_DESCRIPTION.ADD_ORIGINAL_USER_DESCRIPTION: true

Some kind of templating / short-code expansion support would still be useful for more advanced customization but these options are helping a lot already!

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

No branches or pull requests

5 participants