Skip to content

bf: ARSN-494 exception when parsing replication config without endpoint#2382

Merged
bert-e merged 4 commits intodevelopment/7.10from
bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
May 12, 2025
Merged

bf: ARSN-494 exception when parsing replication config without endpoint#2382
bert-e merged 4 commits intodevelopment/7.10from
bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration

Conversation

@jonathan-gramain
Copy link
Copy Markdown
Contributor

Fix an exception that occurs when parsing a ReplicationConfiguration (provided from a PutBucketReplication API call) where no replication endpoint is configured in Cloudserver.

In such case, return an InvalidRequest error.

Also added new test cases for ReplicationConfiguration, which lacked unit test coverage.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 9, 2025

Hello jonathan-gramain,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 9, 2025

Incorrect fix version

The Fix Version/s in issue ARSN-494 contains:

  • 7.10.66

  • 7.70.43

  • 8.2.14

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 7.10.67

  • 7.70.43

  • 8.1.153

  • 8.2.14

Please check the Fix Version/s of ARSN-494, or the target
branch of this pull request.

@jonathan-gramain
Copy link
Copy Markdown
Contributor Author

/create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 9, 2025

Incorrect fix version

The Fix Version/s in issue ARSN-494 contains:

  • 7.10.66

  • 7.70.43

  • 8.1.153

  • 8.2.14

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 7.10.67

  • 7.70.43

  • 8.1.153

  • 8.2.14

Please check the Fix Version/s of ARSN-494, or the target
branch of this pull request.

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 9, 2025

Conflict

A conflict has been raised during the creation of
integration branch w/7.70/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration with contents from bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
and development/7.70.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/7.70/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration origin/development/7.70
 $ git merge origin/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/7.70/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 9, 2025

Conflict

A conflict has been raised during the creation of
integration branch w/8.1/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration with contents from w/7.70/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
and development/8.1.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/8.1/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration origin/development/8.1
 $ git merge origin/w/7.70/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/8.1/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 9, 2025

Conflict

A conflict has been raised during the creation of
integration branch w/8.2/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration with contents from w/8.1/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
and development/8.2.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/8.2/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration origin/development/8.2
 $ git merge origin/w/8.1/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/8.2/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 9, 2025

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

The following options are set: create_integration_branches

@jonathan-gramain jonathan-gramain requested a review from Copilot May 9, 2025 22:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an exception in ReplicationConfiguration parsing when no replication endpoint is configured in Cloudserver and improves test coverage for various configuration scenarios.

  • Adds comprehensive unit tests for both valid and invalid replication configurations.
  • Refactors error message construction in ReplicationConfiguration.ts for clarity and consistency.
  • Updates minor dependencies, including the package version and GitHub Actions configuration.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/unit/models/ReplicationConfiguration.spec.ts New unit tests covering valid and invalid configuration scenarios
lib/models/ReplicationConfiguration.ts Refactored error messages and added endpoint check for replication config
package.json Updated project version
.github/workflows/tests.yaml Upgraded Node setup action from v2 to v4
Comments suppressed due to low confidence (1)

lib/models/ReplicationConfiguration.ts:427

  • The new check returning errors.InvalidRequest.customizeDescription('No configured replication endpoint') may not strictly equal errors.InvalidRequest in the tests. Consider verifying that the tests compare error codes or properties rather than relying on strict object equality.
const { replicationEndpoints } = this._config;

Add test cases to cover most of the validation of the
ReplicationConfiguration model, which did not have unit test coverage.

Also polished some error messages and the code style, as we now have a
more relaxed linter than when the code was originally written.

Note that the error types returned are kept and tested as they are
now, even if they may benefit from a more consistent handling, to
avoid any risk of regression due to a behavior change. We could
revisit this later, separately from this bugfix.
Fix an exception that occurs when parsing a ReplicationConfiguration
(provided from a `PutBucketReplication` API call) where no replication
endpoint is configured in Cloudserver.

In such case, return an InvalidRequest error.
@jonathan-gramain jonathan-gramain force-pushed the bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration branch from a6cdcb6 to 4d12025 Compare May 12, 2025 19:22
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 12, 2025

History mismatch

Merge commit #1baf548588e4d7004279339c9cff140aa4939df8 on the integration branch
w/7.70/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration is merging a branch which is neither the current
branch bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration nor the development branch
development/7.70.

It is likely due to a rebase of the branch bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration and the
merge is not possible until all related w/* branches are deleted or updated.

Please use the reset command to have me reinitialize these branches.

The following options are set: create_integration_branches

@jonathan-gramain
Copy link
Copy Markdown
Contributor Author

/reset

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 12, 2025

Reset complete

I have successfully deleted this pull request's integration branches.

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 12, 2025

Conflict

A conflict has been raised during the creation of
integration branch w/7.70/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration with contents from bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
and development/7.70.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/7.70/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration origin/development/7.70
 $ git merge origin/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/7.70/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 12, 2025

Conflict

A conflict has been raised during the creation of
integration branch w/8.1/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration with contents from w/7.70/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
and development/8.1.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/8.1/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration origin/development/8.1
 $ git merge origin/w/7.70/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/8.1/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 12, 2025

Conflict

A conflict has been raised during the creation of
integration branch w/8.2/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration with contents from w/8.1/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
and development/8.2.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/8.2/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration origin/development/8.2
 $ git merge origin/w/8.1/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/8.2/bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration

The following options are set: create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 12, 2025

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

The following options are set: create_integration_branches

@jonathan-gramain
Copy link
Copy Markdown
Contributor Author

/approve

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 12, 2025

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/7.10

  • ✔️ development/7.70

  • ✔️ development/8.1

  • ✔️ development/8.2

The following branches have NOT changed:

  • development/6.4
  • development/7.4

Please check the status of the associated issue ARSN-494.

Goodbye jonathan-gramain.

The following options are set: approve, create_integration_branches

@bert-e bert-e merged commit 4d12025 into development/7.10 May 12, 2025
5 checks passed
@bert-e bert-e deleted the bugfix/ARSN-494-cloudserverCrashPuttingReplicationConfiguration branch May 12, 2025 22:41
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.

7 participants