JS Pull-requests

by ADMIN 17 views

Introduction

As a developer, managing JavaScript pull requests can be a daunting task, especially when dealing with multiple repositories and dependencies. In this article, we will delve into the world of automated JavaScript pull requests, exploring the process of triaging, updating, and manually creating these requests.

Triage Instructions

When it comes to triaging JavaScript pull requests, it's essential to follow a set of guidelines to ensure that the process is efficient and effective. Here are the steps to follow:

Step 1: Labeling

  • Put on the following labels:
    • type/enhancement
    • impact/low
    • affects/v5
  • These labels will help identify the type of pull request, its impact, and the version of the module it affects.

Step 2: Moving to the Ready Column

  • Move this issue to the "Ready" column on our internal Zenhub board
  • This will ensure that the pull request is ready for review and can be easily tracked by the team.

Update JavaScript Pull Requests

When updating JavaScript pull requests, it's crucial to follow a set of steps to ensure that the process is smooth and efficient. Here are the steps to follow:

Step 1: Listing Update JavaScript Pull Requests

Step 2: Merging Pull Requests

  • Merge these PRs if there are no merge-conflicts
  • If there are merge conflicts in some PRs, then manually run the "Update JS" GitHub action in the affected module.
  • The GitHub action will automatically close the old PR and delete the old branch.

Step 3: Resolving Merge Conflicts

  • If the new PRs still have merge conflicts, then close those PRs and run the steps below in the "Manually creating update JavaScript pull requests" section below for those relevant modules
  • This will ensure that the merge conflicts are resolved and the pull requests can be updated successfully.

Manually Creating Update JavaScript Pull Requests

When manually creating update JavaScript pull requests, it's essential to follow a set of steps to ensure that the process is smooth and efficient. Here are the steps to follow:

Step 1: Checking Out the Default Branch

  • Ensure you have the default branch checked out for the module you are updating e.g. 5
  • This will ensure that you are working on the correct branch.

Step 2: Installing Silverstripe Admin

  • Ensure silverstripe/silverstripe-admin is installed in a sibling directory
  • This will provide access to the necessary dependencies and tools.

Step 3: Checking Out the Default Branch of Silverstripe Admin

  • In the silverstripe-admin directory, ensure the default branch is checked out e.g. 2
  • This will ensure that you are working on the correct branch.

Step 4: Installing Dependencies

  • In the silverstripe-admin directory, run yarn install
  • This will install the necessary dependencies.

Step 5: Upgrading Dependencies

  • In the directory of the module you're updating JS for, run yarn upgrade
  • This will upgrade the dependencies to the latest version.

Step 6: Building the Module

  • Run yarn build in the directory of the module you're updating JS for
  • This will build the module and update the dependencies.

Step 7: Committing and Pushing Changes

  • Git commit, push the changes and create a pull-request
  • This will create a new pull request with the updated dependencies.

Step 8: Listing the Pull Request

  • List the pull-request(s) on this issue
  • This will ensure that the pull request is tracked and can be easily reviewed by the team.

Step 9: Moving to the Peer Review Column

  • Move this issue to the peer review column on the CMS Squad internal Zenhub board
  • This will ensure that the pull request is reviewed by the team and can be merged into the main branch.

Conclusion

Q: What is the purpose of the .github/workflows/js-prs-issue.yml workflow?

A: The .github/workflows/js-prs-issue.yml workflow is used to automatically create a new issue every 6 months to list all the automatically created JavaScript pull requests.

Q: How do I triage JavaScript pull requests?

A: To triage JavaScript pull requests, follow these steps:

  1. Put on the following labels:
    • type/enhancement
    • impact/low
    • affects/v5
  2. Move this issue to the "Ready" column on our internal Zenhub board

Q: What is the purpose of the "Update JS" GitHub action?

A: The "Update JS" GitHub action is used to automatically close the old PR and delete the old branch when there are merge conflicts in some PRs.

Q: How do I manually create update JavaScript pull requests?

A: To manually create update JavaScript pull requests, follow these steps:

  1. Ensure you have the default branch checked out for the module you are updating e.g. 5
  2. Ensure silverstripe/silverstripe-admin is installed in a sibling directory
  3. In the silverstripe-admin directory, ensure the default branch is checked out e.g. 2
  4. In the silverstripe-admin directory, run yarn install
  5. In the directory of the module you're updating JS for, run yarn upgrade
  6. Run yarn build in the directory of the module you're updating JS for
  7. Git commit, push the changes and create a pull-request
  8. List the pull-request(s) on this issue
  9. Move this issue to the peer review column on the CMS Squad internal Zenhub board

Q: What is the purpose of the "Manually creating update JavaScript pull requests" section?

A: The "Manually creating update JavaScript pull requests" section provides a step-by-step guide on how to manually create update JavaScript pull requests when there are merge conflicts in some PRs.

Q: How do I resolve merge conflicts in JavaScript pull requests?

A: To resolve merge conflicts in JavaScript pull requests, follow these steps:

  1. Close the PRs with merge conflicts
  2. Run the steps in the "Manually creating update JavaScript pull requests" section for the relevant modules

Q: What is the purpose of the "Update JavaScript pull requests" section?

A: The "Update JavaScript pull requests" section provides a step-by-step guide on how to update JavaScript pull requests when there are no merge conflicts.

Q: How do I update JavaScript pull requests?

A: To update JavaScript pull requests, follow these steps:

  1. List the update JavaScript pull requests
  2. Merge the PRs if there are no merge-conflicts
  3. If there are merge conflicts in some PRs, then manually run the "Update JS" GitHub action in the affected module
  4. If the new PRs still have merge conflicts, then close those PRs and run the steps in the "Manually creating update JavaScript pull requests" section for the relevant modules

Q: What is the purpose of the "Triage instructions" section?

A: The "Triage instructions" section provides a step-by-step guide on how to triage JavaScript pull requests.

Q: How do I triage JavaScript pull requests?

A: To triage JavaScript pull requests, follow these steps:

  1. Put on the following labels:
    • type/enhancement
    • impact/low
    • affects/v5
  2. Move this issue to the "Ready" column on our internal Zenhub board

Conclusion

In conclusion, the frequently asked questions section provides a comprehensive guide on how to manage JavaScript pull requests, including triaging, updating, and manually creating new pull requests. By following these steps, you can ensure that your JavaScript pull requests are up-to-date and can be easily reviewed by the team.