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

puLL-Merge: initial release #1

Merged
merged 2 commits into from
Nov 30, 2023
Merged

puLL-Merge: initial release #1

merged 2 commits into from
Nov 30, 2023

Conversation

thypon
Copy link
Member

@thypon thypon commented Nov 28, 2023

No description provided.

@thypon thypon force-pushed the features/initial-release branch 20 times, most recently from 7f93abf to 51cbc14 Compare November 29, 2023 18:53
@brave brave deleted a comment from github-actions bot Nov 29, 2023
@brave brave deleted a comment from github-actions bot Nov 29, 2023
@brave brave deleted a comment from github-actions bot Nov 29, 2023
@thypon thypon force-pushed the features/initial-release branch 2 times, most recently from 99cf570 to ca73ff0 Compare November 29, 2023 18:58
@brave brave deleted a comment from github-actions bot Nov 29, 2023
@thypon thypon force-pushed the features/initial-release branch 2 times, most recently from 298119b to e19d0b0 Compare November 29, 2023 19:00
@brave brave deleted a comment from github-actions bot Nov 29, 2023
@thypon thypon force-pushed the features/initial-release branch from e19d0b0 to bd80267 Compare November 29, 2023 19:02
@thypon thypon force-pushed the features/initial-release branch 3 times, most recently from 86744d7 to 5ebc2b8 Compare November 29, 2023 19:16
Copy link

github-actions bot commented Nov 29, 2023

[puLL-Merge] - brave-experiments/pull-merge@don'tremove

The provided patch includes several commits that introduce a GitHub Action for a project, presumably brave/pull-merge. This Action seems to be designed to interact with pull requests on GitHub using the capabilities of a large language model (LLM), possibly an OpenAI model, to add automated comments or perform other operations. Here's a summary of the key changes in the patch:

  1. Initial commit that creates action.yml, a configuration file for the GitHub Action, and introduces a simple console.log command.

  2. The console.log text changes from 'antani' to 'rerun', suggesting an iterative development process.

  3. Multiple changes are made to .github/workflows/loop.yml which may be another GitHub Actions workflow, reducing complexity in the workflow file.

  4. loop.yml is modified to adjust the conditions under which it runs.

  5. loop.yml is updated to include a strategy that disables fast failure, allowing all jobs to finish running even if one fails.

  6. Within loop.yml, the use of a self-reference (possibly to use the action within its workflow) is switched to using a bash shell instead.

  7. The action.yml commit simplifies the file by replacing the initial verbose script with a simple bash echo command. This suggests the developer is restructuring the action's steps.

  8. Reintroduces the self-reference in .github/workflows/loop.yml, suggesting that the action will invoke itself as a part of the workflow.

  9. Introduces input arguments to action.yml for github_token and debug, configuring the action to require a GitHub token and optionally enable debugging.

  10. Updates loop.yml to pass the new debug and github_token inputs when invoking the action, enabling authentication and optional debug logging.

  11. Re-adds an OpenAI script within action.yml that was previously commented out.

  12. Limits the loop.yml to respond only to pull request events, removing the dispatch on push and workflow_dispatch.

  13. Removes the initial console output from action.yml, suggesting a move towards utilizing actual functionality rather than placeholders.

  14. Adds package-lock.json and package.json with openai npm package as a dependency, preparing for integration with OpenAI's services.

  15. Fixes syntax in action.yml by removing an accidental character in the name property.

  16. Creates a new file run.js to provide a local testing mechanism for running JavaScript modules, and also introduces a new module openaiExplainPatch.js.

  17. Fixes the action.yml name property.

  18. Introduces openaiExplainPatch.js with the intention of explaining the contents of patches using the OpenAI model.

  19. Adds a usage section to the README.md file that provides instructions on how to configure the GitHub Action in other repositories.

  20. Updates action.yml to import the openaiExplainPatch.js module, preparing for OpenAI integration.

  21. Updates action.yml to fix a path issue where scripts from the action were not being correctly imported.

  22. Makes preparations within .github/workflows/loop.yml and action.yml for passing the OpenAI API key as an environment variable.

  23. Corrects a syntax error in action.yml by wrapping the openaiKey parameter within an object when calling the explainPatch function.

  24. Further wires in the required environment variables necessary for openaiExplainPatch.js to work, including repository details.

  25. Fixes a typo in action.yml where 'openapi' should have been 'openai'.

  26. Updates openaiExplainPatch.js to retrieve only the body of a pull request patch.

  27. Adds the @octokit/core npm package for GitHub API interactions, allowing the Action to deal with private patches. The openaiExplainPatch.js file also receives updates to use the GitHub API via Octokit.

  28. Modifies action.yml to include the automated commentary extracted from the pull request patch into the issue comments.

  29. Quickly follows up with a fix to resolve a constant assignment issue in action.yml.

  30. Deletes scaffold code in action.yml, replacing the placeholder with actual functionality to clean up comments from previous runs and to post new comments with explanations from OpenAI.

  31. Changes action.yml to use the GraphQL API for deleting comments, rather than the REST API.

  32. Unstubs the openaiExplainPatch.js, indicating that the functionality is implemented and should no longer return placeholder content.

  33. Finally, the openaiExplainPatch.js is modified to try with a different OpenAI model, possibly GPT-4, with an increased token limit for the explanation generation.

Overall, these changes are iterative developments to create, refine, and deploy a GitHub Action that integrates an LLM (like OpenAI) to provide explanations of patches in pull requests. This type of automation could be useful in projects for automatically generating insights or explanations about code changes to assist developers and reviewers.

@thypon thypon requested a review from a team November 29, 2023 22:16
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
openai 4.20.1 network, filesystem, environment +28 7.44 MB dschnurr-openai
@octokit/core 5.0.2 network +12 5.02 MB octokitbot

@thypon thypon force-pushed the features/initial-release branch from f9ade91 to 30e6710 Compare November 29, 2023 22:32
@thypon thypon changed the title action.yml: initial release stub puLL-Merge: initial release Nov 29, 2023
@stoletheminerals
Copy link

Is there a way, using YAML directives inside action.yml, to limit action's visibility to public repos only?

@thypon
Copy link
Member Author

thypon commented Nov 29, 2023

Not inside that action, security-action will take care of not running it in private repos

@thypon thypon force-pushed the features/initial-release branch from 0fe7ae3 to 570130c Compare November 30, 2023 00:13
Copy link

[puLL-Merge] - brave/pull-merge@1

The patch you're asking about consists of multiple commits meant to set up and modify a GitHub Actions workflow for a project named puLL-Merge. This custom GitHub Action seems designed to add language model (LLM) capabilities, like those provided by OpenAI's GPT models, to automatically analyze and explain pull request changes on GitHub repositories.

Here's a breakdown of the significant changes:

Initial commit (patch 1 of 2)

  • .github/workflows/loop.yml: Modifications in the workflow configuration to include a step that presumably uses OpenAI to analyze and comment on pull requests.
  • README.md: The documentation was updated with instructions for using the newly created action.
  • action.yml: This file details the configuration for the puLL-Merge GitHub Action. It includes inputs for configuring the OpenAI API key and reactions for the action when a pull request event occurs.
  • package-lock.json and package.json: These files were introduced to manage dependencies. The project relies on @octokit/core for interfacing with the GitHub API and openai for integrating OpenAI's API.
  • run.js: This appears to be a script for executing a module from the command line, taking arguments and handing them off to the module for processing.
  • src/openaiExplainPatch.js: This is a JavaScript module responsible for doing the heavy lifting of interacting with OpenAI's API to explain the patch and adds a watermark to the explanation comment to identify it.

Second commit (patch 2 of 2)

  • action.yml: A change made to not fail the action eagerly. Now wrapped the explainPatch function call in a try block and logs any error, indicating that errors during the process should not cause the entire action to fail.

Overall, these patches set up and subsequently modify a GitHub Action (puLL-Merge) that integrates OpenAI's language model into GitHub Pull Requests, enabling an automated explanation of submitted patches to aid in code review. The commits are from Andrea Brancaleoni, with the email addresses miwaxe@gmail.com and abc@pompel.me.

@thypon thypon merged commit 33f3476 into main Nov 30, 2023
4 checks passed
@thypon thypon deleted the features/initial-release branch November 30, 2023 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants