← Back to Pull requests

Do not show image's encryption algorithm in "namespace list" #2078

Merged
gbregman merged 4 files (266 lines) on Aug 16, 2026 10:57 UTC
View on GitHub
gbregman gbregman commented on Aug 16, 2026 09:41 UTC
Author

Fixes: #2077

Diff: 266 lines (+121 / -145) across 4 files Reviewer: caroav Review duration: 75m
All Vouch review confidence checks passed
Residual risk 0.09 = Change Risk (0.70) × (1 − Review Confidence (0.87)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.70 · 266 lines diff across 4 files
0.70
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.88 · 5 substantive comment(s)
0.88
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
87%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.334
Sensitive Paths sensitive_paths
0.070
Empty Description empty_description
0.060
Real PR Conversation Timeline
13 items
Copilot Copilot commented on code on Aug 16, 2026 09:45 UTC
Code Review
control/proto/gateway.proto:1
@@ -818,10 +818,9 @@ message namespace_cli {
 	optional string rbd_data_pool_name = 22;
 	optional string location = 23;
 	optional string rados_namespace_name = 24;
-	optional EncryptionAlgorithm encryption_algorithm = 25;
-	repeated encryption_entry encryption_entries = 26;
-	optional bool degraded = 27;
-	optional bool pinned = 28;
+	repeated encryption_entry encryption_entries = 25;
+	optional bool degraded = 26;
+	optional bool pinned = 27;

In protobuf, removing encryption_algorithm is fine, but reusing its field number (25) and renumbering the subsequent fields (encryption_entries, degraded, pinned) breaks wire compatibility. A new client will no longer be able to read encryption_entries from an older gateway (still sending it as field 26), and older clients will misinterpret/ignore the shifted fields. Keep the existing field numbers for the remaining fields and reserve field number 25 (and the name) so older gateways' encryption_algorithm is ignored without breaking encryption_entries decoding, then regenerate generated stubs.

Copilot Copilot commented on code on Aug 16, 2026 09:45 UTC
Code Review
tests/test_rbd_encrypt.py:1
@@ -1053,10 +1053,6 @@ def test_create_with_encryption(caplog, two_gateways):
                             f'encryption_algorithm: no_algorithm, context: <', 5)
     wait_for_string(caplog, f'encryption_entries: [(format: luks1, key id: {key_id})], '
                             f'encryption_algorithm: no_algorithm, context: None', 60)
-    caplog.clear()
-    cli(["--format", "json", "namespace", "list", "--subsystem", subsystem1, "--nsid", "1"])
-    wait_for_string(caplog, '"encryption_algorithm": "aes256"', 5)
-    assert '"encryption_algorithm": "no_algorithm"' not in caplog.text
 
 

This test no longer validates the PR's behavior change. It should still run namespace list --format json and assert the encryption_algorithm field is absent (not just stop checking it), otherwise regressions in the CLI output won't be caught.

Copilot Copilot commented on code on Aug 16, 2026 09:45 UTC
Code Review
tests/test_rbd_encrypt.py:1
@@ -1257,14 +1251,12 @@ def test_list_namespaces(caplog, two_gateways):
     assert '"nsid": 1' in caplog.text
     assert '"format": "luks1"' in caplog.text
     assert f'"key_id": "{key_id}"' in caplog.text
-    assert '"encryption_algorithm": "aes256"' in caplog.text
     caplog.clear()

This test should assert that namespace list --format json no longer includes the encryption_algorithm field (for server A), otherwise the change isn't actually verified.

This issue also appears on line 1255 of the same file.

Copilot Copilot commented on code on Aug 16, 2026 09:45 UTC
Code Review
tests/test_rbd_encrypt.py:1
@@ -1177,14 +1173,12 @@ def test_encryption_algorithm_update(caplog, two_gateways):
     assert '"nsid": 1' in caplog.text
     assert '"format": "luks1"' in caplog.text
     assert f'"key_id": "{key_id}"' in caplog.text
-    assert '"encryption_algorithm": "aes128"' in caplog.text
     caplog.clear()

To ensure the encryption algorithm is no longer exposed by namespace list --format json, add an explicit assertion that the encryption_algorithm field is not present in the output (for server A).

This issue also appears on line 1177 of the same file.

copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Aug 16, 2026 09:45 UTC
Reviewer

Pull request overview

Removes the RBD image encryption algorithm from namespace list output, aligning with #2077’s requirement that the algorithm is generally unknowable after image creation.

Changes:

  • Stop including encryption_algorithm in the list_namespaces gRPC response (namespace_cli).

  • Update the protobuf schema and regenerated Go bindings to drop namespace_cli.encryption_algorithm.

  • Adjust encryption tests by removing assertions that expected the algorithm to appear in namespace list JSON.
  • Reviewed changes

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

    | File | Description |
    | ---- | ----------- |
    | control/grpc.py | Removes computation/propagation of encryption_algorithm from list_namespaces response objects. |
    | control/proto/gateway.proto | Drops namespace_cli.encryption_algorithm and renumbers subsequent fields (compatibility concern). |
    | lib/go/nvmeof/gateway.pb.go | Regenerated Go protobuf output reflecting the updated namespace_cli message. |
    | tests/test_rbd_encrypt.py | Removes checks that namespace list --format json prints encryption_algorithm (needs explicit absence assertions). |

    <details>
    <summary>Files not reviewed (1)</summary>

    lib/go/nvmeof/gateway.pb.go: Generated file
    </details>

    <details>
    <summary>Suppressed comments (2)</summary>

    tests/test_rbd_encrypt.py:1181
    To ensure the encryption algorithm is no longer exposed by namespace list --format json, add an explicit assertion that the encryption_algorithm field is not present in the output (for server B).

        cli(["--format", "json", "--server-port", portB, "namespace", "list",
             "--subsystem", subsystem1, "--nsid", "1"])
        assert '"nsid": 1' in caplog.text
        assert '"format": "luks1"' in caplog.text
        assert f'"key_id": "{key_id}"' in caplog.text
    

    tests/test_rbd_encrypt.py:1259
  • This test should assert that namespace list --format json no longer includes the encryption_algorithm field (for server B), otherwise the change isn't actually verified.

  •     cli(["--format", "json", "--server-port", portB, "namespace", "list",
             "--subsystem", subsystem1, "--nsid", "1"])
        assert '"nsid": 1' in caplog.text
        assert '"format": "luks1"' in caplog.text
        assert f'"key_id": "{key_id}"' in caplog.text
    

    </details>

    ---

    💡 <a href="/ceph/ceph-nvmeof/new/devel?filename=.github/skills/code-review/SKILL.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add a code-review agent skill</a> or configure MCP servers for context-aware, tailored reviews. <a href="https://docs.github.com/en/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review#mcp-servers-and-agent-skills" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn more in the docs.</a>

    gbregman gbregman commented on code on Aug 16, 2026 09:50 UTC
    Code Review
    control/proto/gateway.proto:1
    @@ -818,10 +818,9 @@ message namespace_cli {
     	optional string rbd_data_pool_name = 22;
     	optional string location = 23;
     	optional string rados_namespace_name = 24;
    -	optional EncryptionAlgorithm encryption_algorithm = 25;
    -	repeated encryption_entry encryption_entries = 26;
    -	optional bool degraded = 27;
    -	optional bool pinned = 28;
    +	repeated encryption_entry encryption_entries = 25;
    +	optional bool degraded = 26;
    +	optional bool pinned = 27;

    changed

    gbregman gbregman commented on code on Aug 16, 2026 09:51 UTC
    Code Review
    tests/test_rbd_encrypt.py:1
    @@ -1257,14 +1251,12 @@ def test_list_namespaces(caplog, two_gateways):
         assert '"nsid": 1' in caplog.text
         assert '"format": "luks1"' in caplog.text
         assert f'"key_id": "{key_id}"' in caplog.text
    -    assert '"encryption_algorithm": "aes256"' in caplog.text
         caplog.clear()

    changed

    gbregman gbregman commented on code on Aug 16, 2026 09:52 UTC
    Code Review
    tests/test_rbd_encrypt.py:1
    @@ -1177,14 +1173,12 @@ def test_encryption_algorithm_update(caplog, two_gateways):
         assert '"nsid": 1' in caplog.text
         assert '"format": "luks1"' in caplog.text
         assert f'"key_id": "{key_id}"' in caplog.text
    -    assert '"encryption_algorithm": "aes128"' in caplog.text
         caplog.clear()

    changed

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Aug 16, 2026 09:59 UTC
    Reviewer

    Pull request overview

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

    <details>
    <summary>Files not reviewed (1)</summary>

    lib/go/nvmeof/gateway.pb.go: Generated file
    </details>

    <details>
    <summary>Suppressed comments (3)</summary>

    tests/test_rbd_encrypt.py:1262
    The portB namespace list --format json output is no longer checked for absence of encryption_algorithm. Add a negative assertion here as well so this test validates the behavior across both gateways.

        cli(["--format", "json", "--server-port", portB, "namespace", "list",
             "--subsystem", subsystem1, "--nsid", "1"])
        assert '"nsid": 1' in caplog.text
        assert '"format": "luks1"' in caplog.text
        assert f'"key_id": "{key_id}"' in caplog.text
        caplog.clear()
    

    control/proto/gateway.proto:822
    encryption_algorithm was removed from namespace_cli, leaving field number 25 unused but not reserved. To prevent accidental reuse (which would break wire compatibility for older clients that may still decode/ignore field 25), reserve the field number and name inside namespace_cli, then regenerate the generated stubs.
    	optional string rbd_data_pool_name = 22;
    	optional string location = 23;
    	optional string rados_namespace_name = 24;
    	repeated encryption_entry encryption_entries = 26;
    	optional bool degraded = 27;
    

    tests/test_rbd_encrypt.py:1182
    The portB namespace list --format json output is no longer checked for absence of encryption_algorithm. Add the same negative assertion as for portA so the test verifies the behavior on both gateways.

    This issue also appears on line 1257 of the same file.

        cli(["--format", "json", "--server-port", portB, "namespace", "list",
             "--subsystem", subsystem1, "--nsid", "1"])
        assert '"nsid": 1' in caplog.text
        assert '"format": "luks1"' in caplog.text
        assert f'"key_id": "{key_id}"' in caplog.text
        cli(["namespace", "del", "--subsystem", subsystem1, "--nsid", "1"])
    

    </details>

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Aug 16, 2026 10:06 UTC
    Reviewer

    Pull request overview

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

    <details>
    <summary>Files not reviewed (1)</summary>

    lib/go/nvmeof/gateway.pb.go: Generated file
    </details>

    <details>
    <summary>Suppressed comments (3)</summary>

    tests/test_rbd_encrypt.py:1262
    This test asserts that encryption_algorithm is absent for the first namespace list call (server A), but it does not assert the same for the second call (server B) before clearing the log. Add a not in assertion for the server B output to fully validate the behavior.

        cli(["--format", "json", "--server-port", portB, "namespace", "list",
             "--subsystem", subsystem1, "--nsid", "1"])
        assert '"nsid": 1' in caplog.text
        assert '"format": "luks1"' in caplog.text
        assert f'"key_id": "{key_id}"' in caplog.text
        caplog.clear()
    

    tests/test_rbd_encrypt.py:1183
    This test verifies that server A's namespace list --format json output omits encryption_algorithm, but it doesn't make the same assertion for the server B call after caplog.clear(). Add the absence assertion for the second listing so the test actually enforces the behavior across both gateways.

    This issue also appears on line 1257 of the same file.

        cli(["--format", "json", "--server-port", portB, "namespace", "list",
             "--subsystem", subsystem1, "--nsid", "1"])
        assert '"nsid": 1' in caplog.text
        assert '"format": "luks1"' in caplog.text
        assert f'"key_id": "{key_id}"' in caplog.text
        cli(["namespace", "del", "--subsystem", subsystem1, "--nsid", "1"])
    

    control/proto/gateway.proto:797
    The field number 25 is correctly reserved, but the removed field name should also be reserved to prevent accidental reuse in a future proto revision (which would break wire compatibility with older clients/servers that still know about encryption_algorithm).
    	reserved 25;
    

    </details>

    caroav caroav approved these changes on Aug 16, 2026 10:37 UTC
    Approved Reviewer

    Approved these changes.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Aug 16, 2026 10:38 UTC
    Reviewer

    Pull request overview

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

    <details>
    <summary>Files not reviewed (1)</summary>

    lib/go/nvmeof/gateway.pb.go: Generated file
    </details>

    <details>
    <summary>Suppressed comments (2)</summary>

    tests/test_rbd_encrypt.py:1261
    This test checks that gateway A omits encryption_algorithm in JSON output, but it doesn't assert the same for the gateway B namespace list call. Add the same negative assertion for the second gateway to fully validate the behavior across both endpoints.

        assert '"nsid": 1' in caplog.text
        assert '"format": "luks1"' in caplog.text
        assert f'"key_id": "{key_id}"' in caplog.text
    

    tests/test_rbd_encrypt.py:1182
  • The test verifies that gateway A's JSON output omits the encryption_algorithm field, but it no longer checks the same for gateway B. Since this test explicitly queries both gateways, it should also assert the field is absent in the second namespace list output to prevent partial regressions.
  • This issue also appears on line 1259 of the same file.

        cli(["--format", "json", "--server-port", portB, "namespace", "list",
             "--subsystem", subsystem1, "--nsid", "1"])
        assert '"nsid": 1' in caplog.text
        assert '"format": "luks1"' in caplog.text
        assert f'"key_id": "{key_id}"' in caplog.text
    

    </details>

    Reviewers
    Assignees
    gbregman gbregman
    Labels
    risk: low confidence: 87% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 70.0% (HIGH) · Higher = larger blast radius
    70.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 87% · Lower = rushed or shallow review
    87%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 9.1% · Safe to merge
    9.1%