8000 fix: remove descending by elrrrrrrr · Pull Request #815 · cnpm/cnpmcore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: remove descending #815

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

Merged
merged 2 commits into from
Jun 27, 2025
Merged

fix: remove descending #815

merged 2 commits into from
Jun 27, 2025

Conversation

elrrrrrrr
Copy link
Member
@elrrrrrrr elrrrrrrr commented Jun 27, 2025

see https://github.com/orgs/community/discussions/152515


  • ♻️ 删除 descending 参数

  • ♻️ remove descending args in changesStream

Summary by CodeRabbit

  • Refactor
    • Simplified the process for handling request URLs when fetching data, removing the explicit addition of certain query parameters. This does not affect user-facing functionality.

@elrrrrrrr elrrrrrrr requested review from fengmk2 and killagu June 27, 2025 07:36
@elrrrrrrr elrrrrrrr added the bug Something isn't working label Jun 27, 2025
Copy link
Contributor
coderabbitai bot commented Jun 27, 2025

Walkthrough

The code modifies how the request URL is constructed for fetching the npm changes stream. It removes the explicit addition of the descending=true query parameter and instead uses the original URL from getChangesStreamUrl directly in the HTTP request.

Changes

File(s) Change Summary
app/common/adapter/changesStream/NpmChangesStream.ts Removed explicit addition of descending=true to the request URL; now uses the URL as returned by getChangesStreamUrl.

Possibly related PRs

Suggested reviewers

  • fengmk2

Poem

A bunny hopped near code so neat,
Saw URLs trimmed, no extra treat.
No more descending tags to see,
Just fetch the stream as it should be.
With every hop, the code runs true—
Simpler, cleaner, through and through! 🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b4cf36e and 191d658.

📒 Files selected for processing (1)
  • app/common/adapter/changesStream/NpmChangesStream.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: test-mysql57-fs-nfs (24, ubuntu-latest)
  • GitHub Check: test-mysql57-s3-nfs (22, ubuntu-latest)
  • GitHub Check: test-postgresql-fs-nfs (24, ubuntu-latest)
  • GitHub Check: test-mysql57-fs-nfs (22, ubuntu-latest)
  • GitHub Check: test-postgresql-fs-nfs (20, ubuntu-latest)
  • GitHub Check: test-postgresql-fs-nfs (22, ubuntu-latest)
  • GitHub Check: test-mysql57-s3-nfs (20, ubuntu-latest)
  • GitHub Check: test-mysql57-fs-nfs (20, ubuntu-latest)
  • GitHub Check: Trag Review
🔇 Additional comments (1)
app/common/adapter/changesStream/NpmChangesStream.ts (1)

44-46: ```shell
#!/bin/bash

Display the full implementation of getChangesStreamUrl in AbstractChangesStream.ts

rg -n "getChangesStreamUrl" -C 30 --type ts app/common/adapter/changesStream/AbstractChangesStream.ts


</details>

</blockquote></details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAM3gADy4lRAYyWngMImjIAHc0ZAcBZnUaejkw2A9sREpIEi8KJua+As8fP0DgxFCMRwE6gA4ARgBWFCxcKsYMbmYmf07ufER1fBcNGGmGWExSZGcPWnwGR3YozMqjpFPEVfwsakhYXFxuRA4Aek+idVhsAQaJjMT7rIiIT7A5jYDDqWSfDKpGr3DAQsYAJlGY027kgzG0WGYing8QY1HgDwmEnwXikyH8RIkmSIV0gAAMUmkMBksmyeM40GwaBRNgBlbiiEnwMk+WQAGlZHOkXJ5RD5ziIZwwoXyyCUkTKkFiFBYip2e2kotw/kFfNiMLEFKw6zxJCmihx005FHg3HElJq0lZiFkzAENMggG8yQDwf2F8BMMmSaOhOrE0GIXS6GJFMNhuJ0vNQogRKqgGfgJGgvBojPpjOAoOl+LEcARiGRlIaoewuLx+MJROI6ZAKkwlFRVOotDo6yYoHBUKhMK3CKRyFQuyw2NquFRcvZHPiXCP5GPlJPNNpdGBDPXTAY0NxuJCtw9PmhaI/hZDdllLdaSEFT4ADk5gAYV/fYrRtZgNFwD4DGiJCDAsSAAEEAEl23XIt6AcJxj3wFtzT/RA3G2RQPHLYcpg8BgbX9R5uTxYlSXJSkiJTABVGwABl+xEMQ43sN1FU5dJmQAXmtYI+SCSh5G4AUhTqAZYnWDx8QAa2ZdAsAACWgaArE6eSek2DDURoD8FXUSAMn8MQvHkQNkFo/gfV+DAq0gHj+J6H0sk6XBsAochynkNlSFwCCLUQaDAOYLiKC8PlciqLAZS8XS2SmJANBeN5s3gdgNH8MzcDZT0qK6EJ+D9J16RIfFLgdSC6FsjBs2wVUwngNh8DwBUqg/ShEAVT9cDQaBZAlBVMHoIgAC9fRE15mUQT1UBI0h6mykpvJoNzphIBJuGyhg7I/DJGObMTlQk3lIHk48lKoFS+GNU13PK7pQj8msjBQyw0K8YV2NRYT3KUbMBUY5BONO5YKENF1uABC76m1dQSrIgxgIeEgayQ6JaxvO9G2Yzi0DwVcOw3KJux3Pw0H3fCj3kUdKInNRLxncm5wUVh1AAfXgWhEBF/wmRIXI6BFnpnFCOsDEF4YAE5hloAA2UZBnRBgGFGdXteGQZTYAZmGNAAAYBFiQYLYAdgYAAWC3RnREhXfNm2nZt12PBVwWoVF8XJelkq5doEWm30IA== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=cnpm/cnpmcore&utm_content=815):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `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 explain this code block.`
  -	`@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 explain its main purpose.`
  - `@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.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

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 generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Copy link
@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @elrrrrrrr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request removes the descending parameter from the changesStream URL, as discussed in the linked GitHub discussion. This simplifies the URL construction and request logic.

Highlights

  • Refactor: Removed the descending parameter from the changesStream URL.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly removes the descending=true query parameter when fetching from the npm changes stream. This is an important bug fix, as using descending=true with a since parameter is not standard for following a CouchDB-style changes feed and was likely causing incorrect synchronization behavior. The change also simplifies the code by removing a redundant URL parsing step. The implementation is clean, correct, and I have not found any issues.

@fengmk2 fengmk2 changed the title fix: descending fix: remove descending Jun 27, 2025
@fengmk2 fengmk2 enabled auto-merge June 27, 2025 07:39
Copy link
trag-bot bot commented Jun 27, 2025

Pull request summary

  • Removed unnecessary URL object creation for the changes stream request.
  • Simplified the request to use the database URL directly.
  • Maintained the same timeout and headers for the HTTP request.

@fengmk2 fengmk2 added this pull request to the merge queue Jun 27, 2025
Merged via the queue into master with commit 1001e1f Jun 27, 2025
12 checks passed
@fengmk2 fengmk2 deleted the fix-descending branch June 27, 2025 07:48
Copy link
codecov bot commented Jun 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.34%. Comparing base (e932624) to head (e9e155a).
Report is 6 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master     #815    +/-   ##
========================================
  Coverage   95.34%   95.34%            
========================================
  Files         196      196            
  Lines       23686    23692     +6     
  Branches     2157     1947   -210     
========================================
+ Hits        22583    22589     +6     
  Misses       1103     1103            

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

fengmk2 pushed a commit that referenced this pull request Jun 27, 2025
[skip ci]

## [4.7.4](v4.7.3...v4.7.4) (2025-06-27)

### Bug Fixes

* remove descending ([#815](#815)) ([1001e1f](1001e1f))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0