Skip to content

Conversation

@nicolas2bert
Copy link
Contributor

No description provided.

@bert-e
Copy link
Contributor

bert-e commented Jan 19, 2026

Hello nicolas2bert,

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
Contributor

bert-e commented Jan 19, 2026

Incorrect fix version

The Fix Version/s in issue S3UTILS-216 contains:

  • None

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

  • 1.18.0

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

@nicolas2bert nicolas2bert changed the base branch from development/1 to development/1.17 January 20, 2026 10:28
@bert-e
Copy link
Contributor

bert-e commented Jan 20, 2026

Incorrect fix version

The Fix Version/s in issue S3UTILS-216 contains:

  • None

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

  • 1.17.1

  • 1.18.0

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

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 17.47573% with 170 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.76%. Comparing base (90dde16) to head (d938738).
⚠️ Report is 2 commits behind head on development/1.17.

Files with missing lines Patch % Lines
replicationAudit/check-replication-permissions.js 17.47% 169 Missing and 1 partial ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##           development/1.17     #365      +/-   ##
====================================================
- Coverage             44.70%   43.76%   -0.95%     
====================================================
  Files                    83       84       +1     
  Lines                  5756     5962     +206     
  Branches               1215     1256      +41     
====================================================
+ Hits                   2573     2609      +36     
- Misses                 3138     3307     +169     
- Partials                 45       46       +1     

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

@bert-e
Copy link
Contributor

bert-e commented Jan 20, 2026

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@nicolas2bert
Copy link
Contributor Author

/create_integration_branches

@bert-e
Copy link
Contributor

bert-e commented Jan 20, 2026

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/1.13
  • development/1.14
  • development/1.15
  • development/1.16
  • development/1.4
  • development/1.7

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

The following options are set: create_integration_branches

@bert-e
Copy link
Contributor

bert-e commented Jan 20, 2026

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

@nicolas2bert nicolas2bert marked this pull request as ready for review January 20, 2026 10:52
// ===========================================================================
// Repd Client
// ===========================================================================
class RepdClient {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: consider the folder Clients/RepdClient.js if you think another script could later use this client

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to have a a single self-contained file with no dependencies.
Some reasons behind it:

  • we can copy it easily
  • it runs anywhere Node.js exists
  • No npm install needed on target

Copy link
Contributor

@anurag4DSB anurag4DSB left a comment

Choose a reason for hiding this comment

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

Do we need functional tests for this? Also, critical code paths like RepdClient class, VaultKeys methods, checkBucketPermissions orchestration, and protocol handling are completely untested(unit tests)
Also, please do update the CLAUDE.md, the new replicationAudit/ directory introduces a significant new operational category but is not reflected in CLAUDE.md's script categories section.

}

return {
data: JSON.parse(buffer.slice(PROTOCOL.HEADER_SIZE, totalLength).toString()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth adding a try catch for JSON.parse?
When called from handleData() event handler, parsing errors will crash the script and leave TCP connections open

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The risk is very low. Repd is a well-tested internal service that always returns valid JSON. A parse error would means there is a serious bug in repd itself or network corruption.

I would leave it as-is for this "diagnostic" script. The try-catch would be defensive overkill for a tool that runs occasionally and targets a trusted internal service.

Comment on lines +24 to +33
const CONFIG = {
inputFile: process.argv[2] || '/root/buckets-with-replication.json',
leaderIp: process.argv[3] || '127.0.0.1',
outputFile: process.argv[4] || '/root/missing-replication-permissions.json',
repdPort: 4300,
dbName: 'vaultdb',
includePolicies: process.argv.includes('--include-policies'),
requestTimeoutMs: 10000,
};

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it intentional that the script uses process.argv for configuration (inputFile, leaderIp, outputFile, flags) instead of following the established environment variable pattern used by other scripts like crrExistingObjects.js and cleanupNoncurrentVersions.js.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It felt simpler for crictl exec workflow:
crictl exec $CONTAINER node script.js input.json $IP output.json
instead of
crictl exec -e VAR=value ...

root@<supervisor-ip>:/root/
```

3. Copy the script to a store node:
Copy link
Contributor

Choose a reason for hiding this comment

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

A storage node is not necessarily a stateless S3 connector.
Instead of using saltstack in this procedure, use Ansible, and target one of the runners_s3 host (for example runners_s3[0]).


```bash
ssh -i ~/.ssh/cloud root@<supervisor-ip> \
"salt 'store-1' cmd.run 'crictl ps | grep scality-vault'"
Copy link
Contributor

Choose a reason for hiding this comment

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

crictl ps | awk '/scality-vault/ {print $1}'

scp -i ~/.ssh/cloud replicationAudit/list-buckets-with-replication.sh root@$SUPERVISOR:/root/
scp -i ~/.ssh/cloud replicationAudit/check-replication-permissions.js root@$SUPERVISOR:/root/

# Step 2: Copy scripts to store node
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of SSHing to the supervisor at each step, add an intermediate step here to connect to the sup's shell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like when each "steps" are quite independent/isolated.

@bert-e
Copy link
Contributor

bert-e commented Jan 20, 2026

Waiting for approval

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

  • the author

  • 2 peers

The following reviewers are expecting changes from the author, or must review again:

The following options are set: create_integration_branches

Comment on lines 15 to 44
1. Copy the script to the supervisor:
```bash
scp replicationAudit/list-buckets-with-replication.sh root@<supervisor-ip>:/root/
```

2. Copy the script to an S3 connector node:
```bash
ssh root@<supervisor-ip> "cd /srv/scality/s3/s3-offline/federation && \
ansible -i env/<env>/inventory runners_s3[0] -m copy \
-a 'src=/root/list-buckets-with-replication.sh dest=/root/'"
```

3. Run the script:
```bash
ssh root@<supervisor-ip> "cd /srv/scality/s3/s3-offline/federation && \
ansible -i env/<env>/inventory runners_s3[0] -m shell \
-a 'bash /root/list-buckets-with-replication.sh'"
```

4. Retrieve the output file:
```bash
ssh root@<supervisor-ip> "cd /srv/scality/s3/s3-offline/federation && \
ansible -i env/<env>/inventory runners_s3[0] -m shell \
-a 'cat /root/buckets-with-replication.json'"
```
Copy link
Contributor

Choose a reason for hiding this comment

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

80% of our customers don't have ssh installed on their laptop.
add an intermediate step that thells the reader to connect through SSH to the supervisor, as root.
and then remove the unnecessary "ssh root@"

Comment on lines 163 to 208
3. Copy the script to an S3 connector node:

```bash
ssh root@<supervisor-ip> "cd /srv/scality/s3/s3-offline/federation && \
ansible -i env/<env>/inventory runners_s3[0] -m copy \
-a 'src=/root/check-replication-permissions.js dest=/root/'"
```

4. Find the vault-metadata repd leader IP:

```bash
ssh root@<supervisor-ip> "cd /srv/scality/s3/s3-offline/federation && \
ansible -i env/<env>/inventory runners_s3[0] -m shell \
-a 'curl -s http://localhost:5300/_/raft/leader'"
```

This returns JSON like `{"ip":"10.160.116.162","port":4300}` - use the `ip` value.

**Note:** Vault metadata uses port 5300 for admin.

5. Find the vault container ID:

```bash
ssh root@<supervisor-ip> "cd /srv/scality/s3/s3-offline/federation && \
ansible -i env/<env>/inventory runners_s3[0] -m shell \
-a 'crictl ps | awk \"/scality-vault/ {print \\\$1}\"'"
```

6. Copy files to `/var/tmp` (mounted in vault container) and run the script:

```bash
VAULT_CONTAINER=<vault-container-id>
LEADER_IP=<leader-ip-from-step-4>

ssh root@<supervisor-ip> "cd /srv/scality/s3/s3-offline/federation && \
ansible -i env/<env>/inventory runners_s3[0] -m shell \
-a 'cp /root/check-replication-permissions.js /var/tmp/ && cp /root/buckets-with-replication.json /var/tmp/ && crictl exec $VAULT_CONTAINER node /var/tmp/check-replication-permissions.js /var/tmp/buckets-with-replication.json $LEADER_IP /var/tmp/missing.json'"
```

7. Retrieve the output:

```bash
ssh root@<supervisor-ip> "cd /srv/scality/s3/s3-offline/federation && \
ansible -i env/<env>/inventory runners_s3[0] -m shell \
-a 'cat /var/tmp/missing.json'"
```
Copy link
Contributor

Choose a reason for hiding this comment

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

same here: add an intermediate step to connect to the supervisor.

Comment on lines 386 to 420
# Step 2: Copy scripts to S3 connector node
ssh root@$SUPERVISOR "cd $FEDERATION_DIR && \
ansible -i env/$ENV/inventory runners_s3[0] -m copy \
-a 'src=/root/list-buckets-with-replication.sh dest=/root/'"
ssh root@$SUPERVISOR "cd $FEDERATION_DIR && \
ansible -i env/$ENV/inventory runners_s3[0] -m copy \
-a 'src=/root/check-replication-permissions.js dest=/root/'"

# Step 3: Run list-buckets-with-replication.sh
ssh root@$SUPERVISOR "cd $FEDERATION_DIR && \
ansible -i env/$ENV/inventory runners_s3[0] -m shell \
-a 'bash /root/list-buckets-with-replication.sh'"

# Step 4: Find the vault-metadata repd leader IP (port 5300)
LEADER_IP=$(ssh root@$SUPERVISOR "cd $FEDERATION_DIR && \
ansible -i env/$ENV/inventory runners_s3[0] -m shell \
-a 'curl -s http://localhost:5300/_/raft/leader'" | sed -n 's/.*"ip":"\([^"]*\)".*/\1/p')
echo "Leader IP: $LEADER_IP"

# Step 5: Find the vault container ID
VAULT_CONTAINER=$(ssh root@$SUPERVISOR "cd $FEDERATION_DIR && \
ansible -i env/$ENV/inventory runners_s3[0] -m shell \
-a 'crictl ps | awk \"/scality-vault/ {print \\\$1}\"'" | tail -1)
echo "Vault container: $VAULT_CONTAINER"

# Step 6: Copy files to /var/tmp and run the permission check script
ssh root@$SUPERVISOR "cd $FEDERATION_DIR && \
ansible -i env/$ENV/inventory runners_s3[0] -m shell \
-a 'cp /root/check-replication-permissions.js /var/tmp/ && cp /root/buckets-with-replication.json /var/tmp/ && crictl exec $VAULT_CONTAINER node /var/tmp/check-replication-permissions.js /var/tmp/buckets-with-replication.json $LEADER_IP /var/tmp/missing.json'"

# Step 7: Retrieve results
ssh root@$SUPERVISOR "cd $FEDERATION_DIR && \
ansible -i env/$ENV/inventory runners_s3[0] -m shell \
-a 'cat /var/tmp/missing.json'"
```
Copy link
Contributor

Choose a reason for hiding this comment

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

same here - add an intermediate step to connect to the sup

Comment on lines 325 to 329
echo "]" >> "$TMP_DIR/results.json"

# Calculate final stats
local repl_count
repl_count=$(jq 'length' "$TMP_DIR/results.json")
Copy link
Contributor

Choose a reason for hiding this comment

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

It works but it's ugly and over-complicating the code.
No need to enclose the results between square brackets and use append_result to have a list of json objects. You could have a non-comma-separated list of json objects in $TMP_DIR/results.json and use jq --slurp to make it an array when needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not know about jq --slurp , thanks

Copy link
Contributor

@scality-gdoumergue scality-gdoumergue left a comment

Choose a reason for hiding this comment

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

thx!

@bert-e
Copy link
Contributor

bert-e commented Jan 21, 2026

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

@nicolas2bert nicolas2bert force-pushed the improvement/S3UTILS-216/tool-crr branch from 8780054 to d938738 Compare January 21, 2026 13:16
@bert-e
Copy link
Contributor

bert-e commented Jan 21, 2026

History mismatch

Merge commit #ede3f330c7a1a3198bfc45f0c2088809c78e83ca on the integration branch
w/1/improvement/S3UTILS-216/tool-crr is merging a branch which is neither the current
branch improvement/S3UTILS-216/tool-crr nor the development branch
development/1.

It is likely due to a rebase of the branch improvement/S3UTILS-216/tool-crr 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

@nicolas2bert
Copy link
Contributor Author

@bert-e reset

@bert-e
Copy link
Contributor

bert-e commented Jan 21, 2026

Reset complete

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

The following options are set: create_integration_branches

@bert-e
Copy link
Contributor

bert-e commented Jan 21, 2026

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/1.13
  • development/1.14
  • development/1.15
  • development/1.16
  • development/1.4
  • development/1.7

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

The following options are set: create_integration_branches

@bert-e
Copy link
Contributor

bert-e commented Jan 21, 2026

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

@nicolas2bert
Copy link
Contributor Author

@bert-e approve

@bert-e
Copy link
Contributor

bert-e commented Jan 21, 2026

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

  • ✔️ development/1.17

  • ✔️ development/1

The following branches have NOT changed:

  • development/1.13
  • development/1.14
  • development/1.15
  • development/1.16
  • development/1.4
  • development/1.7

Please check the status of the associated issue S3UTILS-216.

Goodbye nicolas2bert.

The following options are set: approve, create_integration_branches

@bert-e bert-e merged commit d938738 into development/1.17 Jan 21, 2026
14 of 16 checks passed
@bert-e bert-e deleted the improvement/S3UTILS-216/tool-crr branch January 21, 2026 14:49
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.

6 participants