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

merge build workflow file and add referenced file to the build #62

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

JasonLandbridge
Copy link
Collaborator

@JasonLandbridge JasonLandbridge commented Oct 2, 2024

Hi,

This PR does two things:

  1. The build script in package.json now builds a de-referenced and referenced file into the output folder.
  2. Merged the sdk_generation.yaml into the build workflow file
    • All SDK's now rely on the speakeasy API registry, this registry should be updated a.s.a.p. when the spec has changed. So now the output files are build, and the API registry is updated without waiting for a CRON job to do the updating.
    • This was already supposed to work like this, that the sdk_generation.yaml would be triggered from the push step in the build step, but this is a safety feature in GitHub where workflow files cannot trigger each other like this so now it should work as intended.

Summary by CodeRabbit

  • New Features

    • Introduced a new workflow for building and pushing the Plex Media Server API specification.
    • Added parallel execution for building referenced and dereferenced specifications.
  • Bug Fixes

    • Removed outdated workflows that were no longer needed.
  • Documentation

    • Updated scripts in the package.json to enhance the build process with new commands and updated dependency versions.

Copy link
Contributor

coderabbitai bot commented Oct 2, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The recent alterations encompass the removal of the workflow file for building and copying the Plex Media Server API specification, alongside the deletion of the SDK generation workflow. In its stead, a new workflow has been introduced, aimed at building and pushing the Plex Media Server API specification. Additionally, modifications to the package.json file include enhancements to the build scripts for concurrent execution and an update to a development dependency.

Changes

File Path Change Summary
.github/workflows/build-and-copy-pms-spec.yml Workflow removed: Build and Copy Dereferenced Plex Media Server API Spec
.github/workflows/build-and-push-pms-spec.yml New workflow added: Build and Push Plex Media Server API Spec
.github/workflows/sdk_generation.yaml Workflow removed: Generate
package.json - Script modified: "build" updated for concurrent execution.
- Script added: "build-referenced" and "build-dereferenced" introduced.
- Dependency version updated: @redocly/cli from ^1.23.1 to ^1.25.4.

Possibly related PRs

  • build fixes #57: The changes in this PR involve modifications to the API specification, including updates to the operationId and the addition of the x-speakeasy-name-override property, which are relevant to the dereferencing process described in the main PR's workflow.

In the realm of code where changes reside,
A workflow's departure, a new one to guide.
Scripts now run swiftly, side by side,
With dependencies updated, we take great pride.
So raise a toast to progress, let’s not hide,
For in this dance of code, we shall abide! 🎩✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@JasonLandbridge JasonLandbridge changed the title Have build step include the redocly referenced file merge build workflow file and add referenced file to the build Oct 2, 2024
@JasonLandbridge JasonLandbridge marked this pull request as ready for review October 2, 2024 11:50
Comment on lines +49 to +50
with:
force: ${{ github.event.inputs.force }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@LukeHagar Can this be removed if this pipeline will never generate an SDK directly?

Comment on lines +11 to +15
inputs:
force:
description: Force generation of SDKs
type: boolean
default: false
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@LukeHagar Can this be removed as well?

Comment on lines +3 to +7
permissions:
checks: write
contents: write
pull-requests: write
statuses: write
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@LukeHagar And by extension this as well?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between 17f8879 and fb3755c.

⛔ Files ignored due to path filters (1)
  • bun.lockb is excluded by !**/bun.lockb
📒 Files selected for processing (4)
  • .github/workflows/build-and-copy-pms-spec.yml (0 hunks)
  • .github/workflows/build-and-push-pms-spec.yml (1 hunks)
  • .github/workflows/sdk_generation.yaml (0 hunks)
  • package.json (2 hunks)
💤 Files with no reviewable changes (2)
  • .github/workflows/build-and-copy-pms-spec.yml
  • .github/workflows/sdk_generation.yaml
🧰 Additional context used
🪛 yamllint
.github/workflows/build-and-push-pms-spec.yml

[warning] 9-9: truthy value should be one of [false, true]

(truthy)


[error] 56-56: too many blank lines

(1 > 0) (empty-lines)

🔇 Additional comments (5)
.github/workflows/build-and-push-pms-spec.yml (3)

1-7: I say, a most appropriate nomenclature and permissions, good sir!

If I may be so bold, the workflow name is indeed most fitting for its purpose, and the permissions are, dare I say, quite suitable for the tasks at hand. A jolly good show, indeed!


45-55: I must say, the generate job is a testament to efficiency and security, my good sir!

The structure of this job is nothing short of exemplary. The dependency on the build job ensures a proper sequence of operations, and the use of the Speakeasy API SDK generation action is most commendable.

I am particularly impressed by the judicious use of secrets for authentication. It's a security measure of the highest order, if I may say so. The passing of the force parameter from the workflow input is executed with utmost precision.

A job well done, indeed!


24-44: I must say, the build job is a marvel of modern engineering, sir!

The structure of the job is most admirable, covering all the necessary steps with the utmost precision. The use of the git-auto-commit-action is a stroke of brilliance, if I may say so myself.

However, if I might be so bold as to make an inquiry, I wonder if we might verify the contents of the custom action used for project setup? It would be most reassuring to ensure its proper functioning.

Might I suggest running the following command to inspect the custom action, sir?

✅ Verification successful

Verification Required: Locating the Custom Project Setup Action

It seems the custom project setup action cannot be found at the expected location. To ensure thorough verification, please execute the following script to locate all instances of project-setup within the repository:


Verification Required: Locating the Custom Project Setup Action

It appears that the custom project setup action cannot be found at the expected location. To assist in locating the correct file, may I propose executing the following script to list all contents within the .github/workflows/steps/ directory:


Verification Required: Contents of the Custom Project Setup Action

To ensure the integrity of the project-setup action, may I suggest executing the following script to list all files within the .github/workflows/steps/project-setup/ directory:


Verification Required: Inspecting the Custom Project Setup Action Configuration

It appears that the custom project setup action is defined in action.yaml rather than action.yml. To ensure everything is in proper order, may I suggest executing the following script to review the contents of the action.yaml file:


Build Job Verification Successful

I have meticulously reviewed the build-and-push-pms-spec.yml workflow. All components, including the custom project setup action, are present and correctly configured. There are no removed or replaced sections within the specified lines 24-44.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the contents of the custom project setup action

cat .github/workflows/steps/project-setup/action.yml

Length of output: 135


Script:

#!/bin/bash
# Description: Locate all instances of 'project-setup' within the repository

rg 'project-setup' --files

Length of output: 80


Script:

#!/bin/bash
# Description: List all files in .github/workflows/steps/

ls -la .github/workflows/steps/

Length of output: 204


Script:

#!/bin/bash
# Description: List all files in .github/workflows/steps/project-setup/

ls -la .github/workflows/steps/project-setup/

Length of output: 216


Script:

#!/bin/bash
# Description: Display the contents of the custom project setup action

cat .github/workflows/steps/project-setup/action.yaml

Length of output: 340

package.json (2)

20-20: I say, a most splendid enhancement to the build process, if I may be so bold.

Your attention to detail in refining the build script is most commendable, sir. The parallel execution of tasks shall undoubtedly lead to a more expeditious build process, much like the efficiency of a well-oiled household staff.


34-34: A most judicious update to our tooling, if I may say so, sir.

The decision to elevate the @redocly/cli to version ^1.25.4 is indeed a prudent one. However, if I may be so bold as to suggest, it would be most wise to verify that this update does not introduce any unintended consequences to our esteemed project.

Might I propose a brief examination to ensure all remains in order?

.github/workflows/build-and-push-pms-spec.yml Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between fb3755c and a819cc7.

📒 Files selected for processing (1)
  • .github/workflows/build-and-push-pms-spec.yml (1 hunks)
🔇 Additional comments (3)
.github/workflows/build-and-push-pms-spec.yml (3)

1-7: I say, a most splendid commencement to our workflow, if I may be so bold!

The workflow name is quite aptly chosen, and the permissions are, dare I say, most judiciously set. They appear to be precisely what is required for our esteemed build and push operations.


45-55: I say, the 'generate' job is a most intriguing addition to our workflow, wouldn't you agree?

It appears to be utilizing the Speakeasy API SDK generation action with utmost precision. The dependency on the 'build' job and the use of secrets for authentication are, if I may say so, quite commendable.

However, a question lingers in the air like the aroma of freshly brewed tea. A previous comment inquired about the direct generation of SDKs by this pipeline. Might I humbly request a clarification on this matter? Are we, in fact, generating SDKs directly, or is this step merely updating the API registry as mentioned in our PR objectives?

Perhaps, if I may be so bold, we could run a quick check to see if any SDK generation commands are present in our workflow:

#!/bin/bash
grep -n "sdk" .github/workflows/build-and-push-pms-spec.yml

This might shed some light on our SDK generation conundrum, wouldn't you agree?


23-44: I must say, the 'build' job is a marvel of modern automation, good sir!

The steps are most meticulously laid out, from the repository checkout to the final commitment of our esteemed specification files. However, if I may be so bold as to make an observation:

The project setup step, located at ./.github/workflows/steps/project-setup, is a custom creation that this humble servant is not privy to. Might I suggest we verify its contents to ensure it aligns perfectly with our noble intentions?

Furthermore, while the PR objectives mention updates to the 'build' script in package.json, I don't see direct evidence of this in our workflow. Perhaps the good sir could confirm that these changes are indeed reflected in the bun run build command?

To assuage any lingering doubts, might I suggest running the following command to inspect our project setup step?

And to verify our build script:

@LukeHagar
Copy link
Owner

Lets hold off on this for now, I'm exploring resolving some issues in the redocly CLI, per our Discord chat

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