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

bugfix: fixed urls that missing the customized prefix such as '/apollo' #5138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xworks
Copy link

@xworks xworks commented May 4, 2024

What's the purpose of this PR

Fix bug while importing the configuration's file

Which issue(s) this PR fixes:

Fixes #5137

Brief changelog

Add the prefix path such as /apollo to those urls that were missed in apollo-portal

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.
  • Update the CHANGES log.

Summary by CodeRabbit

  • New Features

    • Enhanced URL construction across various services for configuration export, import, and namespace management to ensure consistency and reliability in different environments.
  • Refactor

    • Integrated AppUtil prefix path method across multiple services to standardize URL generation and improve maintainability.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 4, 2024
Copy link
Contributor

coderabbitai bot commented May 4, 2024

Walkthrough

The changes entail updating URL constructions in various JavaScript files within the apollo-portal project to include a prefix path using AppUtil.prefixPath(). This enhancement ensures that all API requests are properly prefixed, aligning with the application's base path configuration, thereby resolving issues related to incorrect request URLs.

Changes

File Path Change Summary
.../ConfigExportController.js Updated URL constructions for config export and import using AppUtil.prefixPath().
.../import-namespace-modal-directive.js Updated URL in importNamespaceModalDirective to include prefix and additional path segments.
.../services/ClusterService.js, ExportService.js, NamespaceLockService.js Added AppUtil dependency and updated URL constructions to use AppUtil.prefixPath().

Assessment against linked issues

Objective Addressed Explanation
Add /apollo prefix to import configuration request URLs (#5137)

Poem

🐇 Oh hop and skip, the URLs fix,
With a prefix neat, no more tricks.
🌐 From paths that stray, we now refrain,
Apollo's links, they chain again.
🚀 To the stars, our code does leap,
In tidy bounds, the routes we keep.
🎉 Celebrate, for bugs we've chased,
With carrots sweet, this success we taste!


Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 3d14e6f and ae2ab02.
Files selected for processing (6)
  • CHANGES.md (1 hunks)
  • apollo-portal/src/main/resources/static/scripts/controller/ConfigExportController.js (2 hunks)
  • apollo-portal/src/main/resources/static/scripts/directive/import-namespace-modal-directive.js (1 hunks)
  • apollo-portal/src/main/resources/static/scripts/services/ClusterService.js (1 hunks)
  • apollo-portal/src/main/resources/static/scripts/services/ExportService.js (1 hunks)
  • apollo-portal/src/main/resources/static/scripts/services/NamespaceLockService.js (1 hunks)
Files skipped from review as they are similar to previous changes (5)
  • apollo-portal/src/main/resources/static/scripts/controller/ConfigExportController.js
  • apollo-portal/src/main/resources/static/scripts/directive/import-namespace-modal-directive.js
  • apollo-portal/src/main/resources/static/scripts/services/ClusterService.js
  • apollo-portal/src/main/resources/static/scripts/services/ExportService.js
  • apollo-portal/src/main/resources/static/scripts/services/NamespaceLockService.js
Additional Context Used
LanguageTool (2)
CHANGES.md (2)

Near line 8: Possible spelling mistake found.
Context: ...--------- * [Fix circular references on LdapAutoConfiguration](https://github.com/apolloconfig/apollo...


Near line 10: Possible spelling mistake found.
Context: ...at the length of private namespaces are mis-calculated](https://github.com/apolloconfig/apollo...


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @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.
  • Please see the configuration documentation 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented May 4, 2024

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

Copy link
Contributor

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

Actionable comments posted: 1

CHANGES.md Outdated Show resolved Hide resolved
shoothzj
shoothzj previously approved these changes May 4, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 4, 2024
Copy link
Contributor

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

Actionable comments posted: 2

Out of diff range and nitpick comments (1)
CHANGES.md (1)

Line range hint 1-1: Add a blank line after "Release Notes." for proper Markdown formatting.

  Release Notes.
+
  Apollo 2.3.0

CHANGES.md Show resolved Hide resolved
CHANGES.md Show resolved Hide resolved
@shoothzj
Copy link
Member

shoothzj commented May 4, 2024

How about use template strings to concatenate strings, and the same type of address prefixes can be put in a common method?

Copy link

stale bot commented Jun 4, 2024

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 14 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale label Jun 4, 2024
@nobodyiam nobodyiam removed the stale label Jun 6, 2024
@nobodyiam
Copy link
Member

How about use template strings to concatenate strings, and the same type of address prefixes can be put in a common method?

This is a great suggestion. However, I think it would require a lot extra work. How about we merge this pr to fix the bug first?

Copy link

stale bot commented Jul 7, 2024

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 14 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale label Jul 7, 2024
@nobodyiam
Copy link
Member

@xworks would you please sign the cla?

@stale stale bot removed the stale label Jul 10, 2024
@xworks
Copy link
Author

xworks commented Jul 10, 2024

@xworks would you please sign the cla?

@nobodyiam 没太明白要我干啥?

@Lyf1122
Copy link

Lyf1122 commented Jul 12, 2024

@xworks would you please sign the cla?

@nobodyiam 没太明白要我干啥?
@xworks
You need to sign the Contributor License Agreement. See the details in the comment of CLA Assistant Lite bot

@xworks
Copy link
Author

xworks commented Jul 24, 2024

I have read the CLA Document and I hereby sign the CLA

I have read the CLA Document and I hereby sign the CLA

@nobodyiam
Copy link
Member

nobodyiam commented Jul 27, 2024

The commit includes two emails; please link them to your GitHub account or update the commit message.

commit ae2ab02d26c1f41f0efe25e21380a8920e0e40e3
Refs: [xworks/master], v2.2.0-22-gae2ab02d2
Author:     xworks <[email protected]>
AuthorDate: Sat May 4 12:19:43 2024 +0800
Commit:     xworks <[email protected]>
CommitDate: Sat May 4 14:32:47 2024 +0800

image

Additionally, please also assist in resolving the conflict.

image

@nobodyiam nobodyiam added this to the 2.4.0 milestone Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
4 participants