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

temporary force skip in derive #386

Merged
merged 5 commits into from
Dec 20, 2023
Merged

temporary force skip in derive #386

merged 5 commits into from
Dec 20, 2023

Conversation

jill64
Copy link
Owner

@jill64 jill64 commented Dec 19, 2023

Summary by CodeRabbit

  • Refactor
    • Simplified the derive function to return "skipped" instead of interacting with external services.

@wraith-ci
Copy link
Contributor

wraith-ci bot commented Dec 19, 2023

Wraith CI 👻 Retry Request

Check the box to re-trigger CI.

  • Wraith CI
  • Wraith CI / PR

Copy link

coderabbitai bot commented Dec 19, 2023

Walkthrough

The derive function within the derive.ts file has undergone a significant transformation. The previous version, which interacted with GitHub's API to update pull requests, has been replaced with a streamlined variant that merely returns the string "skipped." This overhaul has also led to the removal of parameters from the function's signature, signaling a departure from its original purpose.

Changes

File Path Change Summary
.../action/src/ghosts/derive.ts
.../action/dist/index.cjs
Simplified derive function to return "skipped"; removed GitHub API logic and parameters.

Poem

🐇 "In the realm of code, a swift hop we made,
🌟 From complex to simple, our logic now laid.
📜 A function once busy, now taking a nap,
🎉 'Skipped' it returns, with a quiet clap."

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 X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment made by CodeRabbit.
  • You can tag CodeRabbit on specific lines of code or files in the PR by tagging @coderabbitai in a comment.
  • You can tag @coderabbitai in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

Copy link

cloudflare-workers-and-pages bot commented Dec 19, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 27df1d2
Status: ✅  Deploy successful!
Preview URL: https://3e6695d4.wraith-ci.pages.dev
Branch Preview URL: https://dev.wraith-ci.pages.dev

View logs

@wraith-ci wraith-ci bot enabled auto-merge December 19, 2023 23:30
Copy link

codecov bot commented Dec 19, 2023

Codecov Report

Attention: 38 lines in your changes are missing coverage. Please review.

Comparison is base (a212015) 7.10% compared to head (27df1d2) 7.10%.

Files Patch % Lines
packages/action/src/ghosts/derive.ts 0.00% 38 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #386      +/-   ##
========================================
- Coverage   7.10%   7.10%   -0.01%     
========================================
  Files         65      65              
  Lines       2012    2014       +2     
  Branches      73      73              
========================================
  Hits         143     143              
- Misses      1869    1871       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@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.

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 613eb1f and 275576e.
Files selected for processing (1)
  • packages/action/src/ghosts/derive.ts (1 hunks)
Additional comments: 1
packages/action/src/ghosts/derive.ts (1)
  • 3-3: The function signature of derive has been changed to no longer accept any arguments. Verify that this change does not break any existing calls to this function throughout the codebase.

Comment on lines 3 to 5
export const derive: Ghost = async () => {

return 'skipped'
Copy link

Choose a reason for hiding this comment

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

The derive function has been modified to return a hardcoded string "skipped". This is a temporary measure and should be clearly documented in the code, including the reason for the change and any conditions for its future removal or reversion.

export const derive: Ghost = async () => {
+  // TEMPORARY: This function now returns 'skipped' to temporarily bypass its usual operations.
+  // This change was made because [REASON].
+  // TODO: Revert this change when [CONDITION].
  return 'skipped'
}

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.

Suggested change
export const derive: Ghost = async () => {
return 'skipped'
export const derive: Ghost = async () => {
// TEMPORARY: This function now returns 'skipped' to temporarily bypass its usual operations.
// This change was made because [REASON].
// TODO: Revert this change when [CONDITION].
return 'skipped'
}

Copy link

@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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 275576e and 18dca3c.
Files selected for processing (1)
  • packages/action/src/ghosts/derive.ts (1 hunks)
Additional comments: 2
packages/action/src/ghosts/derive.ts (2)
  • 3-4: The derive function has been simplified to return a hardcoded string "skipped". Ensure that this change is well-documented and tracked so that the original functionality can be restored when appropriate.

  • 3-3: The derive function's signature has been modified to no longer accept any arguments. Verify that this change does not affect any other parts of the application that may rely on this function.

Comment on lines +6 to +40
// const { owner, repo } = payload

// const { data: repository } = await octokit.rest.repos.get({
// owner,
// repo
// })

// const { data: list } = await octokit.rest.pulls.list({
// owner,
// repo,
// state: 'open',
// base: repository.default_branch
// })

// if (!list.length) {
// return {
// status: 'skipped',
// detail: 'No open PRs targeting the default branch were found.'
// }
// }

// const result = list.map((pull) =>
// octokit.rest.pulls.updateBranch({
// owner,
// repo,
// pull_number: pull.number
// })
// )

// await Promise.allSettled(result)

// return {
// status: 'success',
// detail: `Updated ${result.length} PRs.`
// }
Copy link

Choose a reason for hiding this comment

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

The original functionality of the derive function is commented out. It's crucial to track this temporary change with a TODO comment or a ticket in the project's issue tracking system to ensure it is addressed in the future.

+  // TODO: The following code has been temporarily disabled. It should be reviewed and
+  // re-enabled once the conditions for the 'temporary force skip' are no longer applicable.
+  // Relevant ticket: [LINK_TO_TICKET]
  // const { owner, repo } = payload
  // ...
  // return {
  //   status: 'success',
  //   detail: `Updated ${result.length} PRs.`
  // }

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.

Suggested change
// const { owner, repo } = payload
// const { data: repository } = await octokit.rest.repos.get({
// owner,
// repo
// })
// const { data: list } = await octokit.rest.pulls.list({
// owner,
// repo,
// state: 'open',
// base: repository.default_branch
// })
// if (!list.length) {
// return {
// status: 'skipped',
// detail: 'No open PRs targeting the default branch were found.'
// }
// }
// const result = list.map((pull) =>
// octokit.rest.pulls.updateBranch({
// owner,
// repo,
// pull_number: pull.number
// })
// )
// await Promise.allSettled(result)
// return {
// status: 'success',
// detail: `Updated ${result.length} PRs.`
// }
// TODO: The following code has been temporarily disabled. It should be reviewed and
// re-enabled once the conditions for the 'temporary force skip' are no longer applicable.
// Relevant ticket: [LINK_TO_TICKET]
// const { owner, repo } = payload
// const { data: repository } = await octokit.rest.repos.get({
// owner,
// repo
// })
// const { data: list } = await octokit.rest.pulls.list({
// owner,
// repo,
// state: 'open',
// base: repository.default_branch
// })
// if (!list.length) {
// return {
// status: 'skipped',
// detail: 'No open PRs targeting the default branch were found.'
// }
// }
// const result = list.map((pull) =>
// octokit.rest.pulls.updateBranch({
// owner,
// repo,
// pull_number: pull.number
// })
// )
// await Promise.allSettled(result)
// return {
// status: 'success',
// detail: `Updated ${result.length} PRs.`
// }

Copy link

@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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 18dca3c and fc7edcd.
Files selected for processing (1)
  • packages/action/dist/index.cjs (1 hunks)

Copy link

@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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between fc7edcd and 6fe181c.
Files selected for processing (1)
  • packages/action/dist/index.cjs (1 hunks)

Copy link

@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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 6fe181c and 27df1d2.
Files selected for processing (1)
  • packages/action/dist/index.cjs (1 hunks)

@wraith-ci wraith-ci bot merged commit e3a3fe6 into main Dec 20, 2023
6 of 9 checks passed
@wraith-ci wraith-ci bot deleted the dev branch December 20, 2023 01:38
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.

1 participant