-
Couldn't load subscription status.
- Fork 19
☕ Check supported versions #255
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
Conversation
|
Warning Rate limit exceeded@lambdalisue has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 26 minutes and 54 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe updates to the repository enhance configuration and version management through the introduction of new scripts and modifications in the GitHub Actions workflow. A new input for specifying branches for testing with Denops, improved version checks, and dynamic version retrieval from JSON sources significantly enhance maintainability and flexibility. Overall, these changes ensure consistency across documentation and CI/CD configurations, making it easier for developers to manage dependencies. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GitHub Actions
participant Update Script
participant Supported Versions Module
User->>GitHub Actions: Trigger workflow
GitHub Actions->>Supported Versions Module: Load supported versions
Supported Versions Module->>GitHub Actions: Return versions
GitHub Actions->>Update Script: Update README and workflows with new versions
Update Script->>GitHub Actions: Successful update
GitHub Actions->>User: Notify completion
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
64aaefc to
45ec29b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Inline review comments failed to post
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- .github/workflows/test.yml (4 hunks)
- .scripts/apply-supported-versions.ts (1 hunks)
- .scripts/gen-function/gen-function.ts (1 hunks)
- .scripts/gen-option/gen-option.ts (1 hunks)
- .scripts/supported_versions.ts (1 hunks)
- README.md (1 hunks)
- deno.jsonc (1 hunks)
Files skipped from review due to trivial changes (1)
- README.md
Additional comments not posted (15)
.scripts/supported_versions.ts (4)
3-7: Type definition looks good.The
SupportedVersionstype definition correctly specifies the structure for supported versions.
9-13: Type guard looks good.The
isSupportedVersionsfunction correctly validates the structure of the supported versions.
15-19: Function looks good.The
getSupportedVersionJsonUrlfunction correctly constructs the URL for fetching the supported versions JSON file.
21-30: Function looks good.The
loadSupportedVersionsfunction correctly fetches and validates the supported versions JSON file..scripts/apply-supported-versions.ts (2)
6-10: Function looks good.The
mainfunction correctly loads the supported versions and updates the README and GitHub workflows.
82-89: Script block looks good.The main script block correctly handles running the script and error handling.
.scripts/gen-option/gen-option.ts (1)
7-11: Code segment looks good.The code segment correctly loads supported versions and defines constants for VIM_VERSION and NVIM_VERSION, improving maintainability and flexibility.
.github/workflows/test.yml (5)
14-18: Add input parameter fordenops_branch.The new input parameter
denops_branchallows specifying a branch for Denops testing. This enhances flexibility in testing different branches.
24-26: Add environment variableDENOPS_BRANCH.The new environment variable
DENOPS_BRANCHcaptures the input for use in subsequent steps, improving configurability.
55-62: Add new checks forgenandsupported version inconsistency.The new steps ensure that the generated code is up-to-date and that there are no inconsistencies in the supported versions. This adds robustness to the workflow.
72-72: Specify exactdeno_versionfor testing.Changing from
"1.45.x"to"1.45.0"ensures that a specific version of Deno is used for testing, which can help avoid issues with version discrepancies.
96-96: Use environment variable for switching Denops branch.Using the environment variable
${{ env.DENOPS_BRANCH }}enhances flexibility in branch management for Denops.deno.jsonc (1)
93-93: Add new command for applying supported versions.The new command
"apply:supported-versions"allows execution of a script to apply supported versions, enhancing the configuration's functionality..scripts/gen-function/gen-function.ts (2)
7-7: ImportloadSupportedVersionsfunction.The new import statement brings in the
loadSupportedVersionsfunction, which will be used to dynamically fetch supported versions.
9-11: Dynamically fetch supported versions.The
supportedVersionsobject is fetched asynchronously, and the VIM and NVIM versions are extracted from it. This change enhances flexibility and maintainability by allowing the code to adapt to version updates without manual changes.
Comments failed to post (2)
.scripts/apply-supported-versions.ts
59-79: Refactor repetitive replacements.
The
updateGithubWorkflowsTestfunction performs repetitive replacements that can be refactored into a loop for better maintainability.async function updateGithubWorkflowsTest( supportedVersions: SupportedVersions, ): Promise<void> { const url = new URL(import.meta.resolve("../.github/workflows/test.yml")); let text = await Deno.readTextFile(url); const replacements = [ { regex: /deno_version:(.*?)"\d+\.\d+\.\d+"/s, value: `deno_version:$1"${supportedVersions.deno}"` }, { regex: /vim:(.*?)"v\d+\.\d+\.\d+"/s, value: `vim:$1"v${supportedVersions.vim}"` }, { regex: /nvim:(.*?)"v\d+\.\d+\.\d+"/s, value: `nvim:$1"v${supportedVersions.neovim}"` }, ]; for (const { regex, value } of replacements) { text = text.replace(regex, value); } await Deno.writeTextFile(url, text); }Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.async function updateGithubWorkflowsTest( supportedVersions: SupportedVersions, ): Promise<void> { const url = new URL(import.meta.resolve("../.github/workflows/test.yml")); let text = await Deno.readTextFile(url); const replacements = [ { regex: /deno_version:(.*?)"\d+\.\d+\.\d+"/s, value: `deno_version:$1"${supportedVersions.deno}"` }, { regex: /vim:(.*?)"v\d+\.\d+\.\d+"/s, value: `vim:$1"v${supportedVersions.vim}"` }, { regex: /nvim:(.*?)"v\d+\.\d+\.\d+"/s, value: `nvim:$1"v${supportedVersions.neovim}"` }, ]; for (const { regex, value } of replacements) { text = text.replace(regex, value); } await Deno.writeTextFile(url, text); }
12-57: Refactor repetitive replacements.
The
updateREADMEfunction performs repetitive replacements that can be refactored into a loop for better maintainability.async function updateREADME( supportedVersions: SupportedVersions, ): Promise<void> { const url = new URL(import.meta.resolve("../README.md")); let text = await Deno.readTextFile(url); const replacements = [ { regex: /Deno\s+\d+\.\d+\.\d+/, value: `Deno ${supportedVersions.deno}` }, { regex: /Deno-Support%20\d+\.\d+\.\d+/, value: `Deno-Support%20${supportedVersions.deno}` }, { regex: /https:\/\/github\.com\/denoland\/deno\/tree\/v\d+\.\d+\.\d+/, value: `https://github.com/denoland/deno/tree/v${supportedVersions.deno}` }, { regex: /Vim\s+\d+\.\d+\.\d+/, value: `Vim ${supportedVersions.vim}` }, { regex: /Vim-Support%20\d+\.\d+\.\d+/, value: `Vim-Support%20${supportedVersions.vim}` }, { regex: /https:\/\/github\.com\/vim\/vim\/tree\/v\d+\.\d+\.\d+/, value: `https://github.com/vim/vim/tree/v${supportedVersions.vim}` }, { regex: /Neovim\s+\d+\.\d+\.\d+/, value: `Neovim ${supportedVersions.neovim}` }, { regex: /Neovim-Support%20\d+\.\d+\.\d+/, value: `Neovim-Support%20${supportedVersions.neovim}` }, { regex: /https:\/\/github\.com\/neovim\/neovim\/tree\/v\d+\.\d+\.\d+/, value: `https://github.com/neovim/neovim/tree/v${supportedVersions.neovim}` }, ]; for (const { regex, value } of replacements) { text = text.replace(regex, value); } await Deno.writeTextFile(url, text); }Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.async function updateREADME( supportedVersions: SupportedVersions, ): Promise<void> { const url = new URL(import.meta.resolve("../README.md")); let text = await Deno.readTextFile(url); const replacements = [ { regex: /Deno\s+\d+\.\d+\.\d+/, value: `Deno ${supportedVersions.deno}` }, { regex: /Deno-Support%20\d+\.\d+\.\d+/, value: `Deno-Support%20${supportedVersions.deno}` }, { regex: /https:\/\/github\.com\/denoland\/deno\/tree\/v\d+\.\d+\.\d+/, value: `https://github.com/denoland/deno/tree/v${supportedVersions.deno}` }, { regex: /Vim\s+\d+\.\d+\.\d+/, value: `Vim ${supportedVersions.vim}` }, { regex: /Vim-Support%20\d+\.\d+\.\d+/, value: `Vim-Support%20${supportedVersions.vim}` }, { regex: /https:\/\/github\.com\/vim\/vim\/tree\/v\d+\.\d+\.\d+/, value: `https://github.com/vim/vim/tree/v${supportedVersions.vim}` }, { regex: /Neovim\s+\d+\.\d+\.\d+/, value: `Neovim ${supportedVersions.neovim}` }, { regex: /Neovim-Support%20\d+\.\d+\.\d+/, value: `Neovim-Support%20${supportedVersions.neovim}` }, { regex: /https:\/\/github\.com\/neovim\/neovim\/tree\/v\d+\.\d+\.\d+/, value: `https://github.com/neovim/neovim/tree/v${supportedVersions.neovim}` }, ]; for (const { regex, value } of replacements) { text = text.replace(regex, value); } await Deno.writeTextFile(url, text); }
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #255 +/- ##
=======================================
Coverage 82.61% 82.61%
=======================================
Files 57 57
Lines 2979 2979
Branches 251 251
=======================================
Hits 2461 2461
Misses 516 516
Partials 2 2 ☔ View full report in Codecov by Sentry. |
Close #249
Summary by CodeRabbit
New Features
Documentation
Chores