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

feat: Add agentic JSDoc generation #1343

Merged
merged 9 commits into from
Dec 27, 2024
Merged

Conversation

Ed-Marcavage
Copy link
Contributor

Relates to:

Risks:

  • Minimal risk: Sometimes it adds an extra astrict in the JSDoc requiring a human to pull the branch locally and remove it, an example is linked.

Background

What does this PR do?

  • The codebase includes a GitHub Actions workflow (JSDoc Automation) that allows triggering the documentation generation process with custom parameters. The workflow is defined in the .github/workflows directory.

What kind of change is this?

  • Features: LLM Based JSDoc generator

Why are we doing this? Any context or related work?

Documentation changes needed?

  • Not needed - already generated

Testing

Where should a reviewer start?

  • packages/jsdoc-automation/src/index.ts

Detailed testing steps

###Configure and trigger the workflow manually

  • The workflow can be triggered manually using the workflow_dispatch event, which accepts the following inputs:
  • pull_number (optional): The pull request number to generate documentation for.
    • if not provided, the root_directory will be scanned
    • PR must be merged to develop/main branch
  • root_directory (required): Only scans files in this directory.
    • Description: Target directory relative to repository root (e.g., packages/core/src)
    • Default: packages/core/src/test_resources - arbitrarily chose this because its small
  • excluded_directories (required): Directories to exclude from scanning.
    • Description: Comma-separated list of directories to exclude, relative to root_directory
    • Default: 'node_modules,dist,test'
  • reviewers (required): Pull Request Reviewers.
    • Description: Comma-separated list of GitHub usernames
    • Default: ''

Set up

  • Set GH_PAT & OPENAI_API_KEY in github actions as secret env variables

Deploy Notes

  • Set GH_PAT & OPENAI_API_KEY in github actions as secret env variables

Discord username

  • 0xbuildinpublic

@odilitime odilitime added the Plugin_new Mark PRs that are a new plugin label Dec 22, 2024
@odilitime odilitime changed the title Add agentic JSDoc generation feat: Add agentic JSDoc generation Dec 22, 2024
@shakkernerd shakkernerd deleted the branch elizaOS:develop December 22, 2024 07:02
@madjin madjin reopened this Dec 22, 2024
@odilitime
Copy link
Collaborator

Hrm it's not really a plugin but lives in the plugins directory... Probably wouldn't take much work to convert to a plugin

@Ed-Marcavage
Copy link
Contributor Author

Ed-Marcavage commented Dec 23, 2024

I am happy to convert it to a plugin; just let me know.

I am not sure if it makes sense as a plugin because it is currently invoked by GH Actions, not an agent, but I could see it being invoked by an agent in the future.

  • Where should it be moved to if it's decided not to be a plugin?
  • If its decided to be a plunging, should it be invokable by both an agent and GH actions?

@Ed-Marcavage
Copy link
Contributor Author

Ed-Marcavage commented Dec 25, 2024

After giving it more thought, I think I'm going to convert it to a plug in. I think it would be dope if you could be developing locally and just prompt eliza "generate documentation for ____" and then this code is executed - automatically generating documentation for the provided directory.

Im going to try and make it executable in two ways 1- GH workflows and 2- if an agent invokes it.

Copy link
Collaborator

@madjin madjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, thanks for moving to scripts folder for now - after making it an eliza plugin can move to packages folder. Excited to use this.

We can tweak in the future based on feedback of the generated API docs + how people feel about the comments in the code (incase they're distracting). Will look into getting this working with correct github token soon. Great contribution!

@madjin madjin added documentation Improvements or additions to documentation good first issue Good for newcomers automation and removed good first issue Good for newcomers labels Dec 27, 2024
@madjin madjin merged commit c9be71e into elizaOS:develop Dec 27, 2024
3 checks passed
1to3for5vi7ate9x pushed a commit to 1to3for5vi7ate9x/eliza that referenced this pull request Jan 26, 2025
feat: Add agentic JSDoc generation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation documentation Improvements or additions to documentation Plugin_new Mark PRs that are a new plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants