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

Fix publish workflow variables #957

Merged
merged 2 commits into from
Jan 11, 2024
Merged

Fix publish workflow variables #957

merged 2 commits into from
Jan 11, 2024

Conversation

goastler
Copy link
Member

No description provided.

Copy link

Pull Request Review Markdown Doc

Hey there! 👋 Here's a summary of the previous results and some sections for your pull request review. Let's get started!

Changes

📝 Task 1:

  1. The code is checking for the next version and the current version in multiple places.
  2. It is comparing the major, minor, and patch versions to determine if a version bump is detected.
  3. If a version bump is detected, it sets the 'bump' variable to true.

Suggestions

🔍 Task 2:

  1. In lines 4 and 5, the variable NEXT_VERSION is assigned the value of VERSION. This seems unnecessary and can be simplified.
  2. In lines 8-11, the major, minor, and patch versions are extracted from NEXT_VERSION and stored in separate variables. This can be done in a more concise way.
  3. In lines 16-19, the same process is repeated for the current version from GitHub. This can be refactored to avoid duplication.
  4. In lines 24-27, the same process is repeated for the current version from npm. This can also be refactored to avoid duplication.

Bugs

🐛 Task 3:

  1. There is a potential bug in lines 8-11 and 16-19 where the major, minor, and patch versions are extracted using the 'cut' command. If the version number has more than three parts, it will not work correctly.
  2. There is another potential bug in lines 24-27 where the current version from npm is obtained using the 'npm view' command. If the package is not published, it will fail and exit the script.

Improvements

🚀 Task 4:

  • One place in the code that could be refactored for better readability is at line 294. The gh release create command can be extracted into a separate function to improve code organization and readability. Here's a code snippet:
function createGithubRelease(version) {
    gh release create --generate-notes "v${version}" "./protocol/target/ink/captcha/captcha.contract" "./protocol/target/ink/proxy/proxy.contract" "./packages/procaptcha-bundle/dist/bundle/procaptcha.bundle.js"
}

createGithubRelease(${steps.next_version.outputs.version})

Rating

⭐️ Task 5:

  • I would rate the code a 7 out of 10. It has decent readability, but there are some areas that could be improved.

Sections

Now, let's structure the pull request review markdown doc with the following sections:

Changes

  1. Major changes in the code can be found at lines 294, 331, 344, and 372.

Suggestions

  1. Line 294: The gh release create command has been modified to use the steps.next_version.outputs.version instead of steps.next_version.outputs.next_version.
  2. Line 331: The curl command has been modified to use the steps.next_version.outputs.version instead of steps.next_version.outputs.next_version.
  3. Line 344: The docker pull command has been modified to use the steps.check_version_docker_js_server.outputs.version instead of latest.
  4. Line 372: The curl command has been modified to use the steps.next_version.outputs.version instead of steps.next_version.outputs.next_version.

Bugs

  • There are no specific files mentioned in the provided code snippet.

Improvements

  • One place in the code that could be refactored for better readability is at line 294. The gh release create command can be extracted into a separate function to improve code organization and readability. Here's a code snippet:
function createGithubRelease(version) {
    gh release create --generate-notes "v${version}" "./protocol/target/ink/captcha/captcha.contract" "./protocol/target/ink/proxy/proxy.contract" "./packages/procaptcha-bundle/dist/bundle/procaptcha.bundle.js"
}

createGithubRelease(${steps.next_version.outputs.version})

Rating

  • I would rate the code a 7 out of 10. It has decent readability, but there are some areas that could be improved.

Premium Plan

By the way, did you know that we offer a premium plan that can analyze big pull requests? It provides even more detailed insights and suggestions to help you improve your code. Consider upgrading to the premium plan for a more comprehensive review experience!

That's it for now! Feel free to customize the sections and add more details as needed. Good luck with your pull request! 🚀

@goastler goastler merged commit 2b65d40 into main Jan 11, 2024
5 checks passed
@goastler goastler deleted the fix-publish-workflow-typo branch January 11, 2024 17:05
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