Skip to content

squid: python-common: multi-line for yaml - #68580

Merged
batrick merged 1 commit into
ceph:squidfrom
timqn22:squid-backport
Jul 27, 2026
Merged

batrick merged 1 commit into
ceph:squidfrom
timqn22:squid-backport

Conversation

@timqn22

@timqn22 timqn22 commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #68034

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

Currently when running the command ceph orch ls --export
multi-line strings are processed using default interpretation
meaning they could be printed with quotations instead of
the expected | . This causes a hassle for users who want to
copy their specifications to new yaml files as they have to
manually modify the yaml to remove the quotes and add | .
My code fixes this by modifying the yaml representer to
check for multi-line strings and wrapping them in a
YamlLiteralString class which will mark the multi-line string
to be processed with | . I've also added unit tests.

Signed-off-by: Timothy Q Nguyen <[email protected]>
(cherry picked from commit 0a73f68)
@timqn22
timqn22 requested a review from a team as a code owner April 23, 2026 22:09
@github-actions github-actions Bot added this to the squid milestone Apr 23, 2026
@batrick batrick added the releng-audit-fail Release engineering: failed backport verification audit. label May 14, 2026
@github-actions github-actions Bot removed the releng-audit-fail Release engineering: failed backport verification audit. label May 14, 2026
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label May 14, 2026
@yuriw

yuriw commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri2-testing-20260602.202206-squid.

@yuriw

yuriw commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri2-testing-20260622.144905-squid.

@yuriw

yuriw commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This PR has been removed from wip-yuri2-testing-20260622.144905-squid.

@yuriw

yuriw commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri5-testing-20260623.145428-squid.

@Naveenaidu

Copy link
Copy Markdown
Contributor

@batrick batrick added the releng-audit-queue Release engineering: queued for backport verification audit. label Jul 27, 2026
@github-actions github-actions Bot removed releng-audit-queue Release engineering: queued for backport verification audit. releng-audit-fail Release engineering: failed backport verification audit. labels Jul 27, 2026
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Jul 27, 2026
@batrick batrick removed the releng-audit-fail Release engineering: failed backport verification audit. label Jul 27, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ceph Release Engineering Audit Report

Commit Parity Visualizer

BACKPORT PR #68580 SOURCE PR SOURCE STATUS
946215d python-common: multi-line for yaml PR #68034 0a73f68 python-common: multi-line for yaml

Automated Backport Parity Review - Cherry-Pick Conflicts / Deviations

⚠️ WARNING: Cherry-pick conflicts or deviations were found that require component lead review.

A conflict or deviation was detected during the simulation of this backport. The code in this PR does not match a clean cherry-pick of the upstream commits.

This does not necessarily indicate an issue but a maintainer should review.

**Click to expand conflict summaries.**

Deviation in Backport 946215d (cherry-pick of 0a73f68)

Affected File(s)

Range Diff

Click to expand
--- Original (0a73f686)
+++ Backport (946215d5)
@@ -12,3 +12,4 @@
 to be processed with | . I've also added unit tests.
 
 Signed-off-by: Timothy Q Nguyen <[email protected]>
+(cherry picked from commit 0a73f686c8734e6545fef48275af56502300a4e7)

================================================================================
RANGE DIFF
================================================================================

1:  0a73f686c87 ! 1:  946215d5c41 python-common: multi-line for yaml
    @@ Commit message
         to be processed with | . I've also added unit tests.
     
         Signed-off-by: Timothy Q Nguyen <[email protected]>
    +    (cherry picked from commit 0a73f686c8734e6545fef48275af56502300a4e7)
     
      ## src/python-common/ceph/deployment/service_spec.py ##
     @@ src/python-common/ceph/deployment/service_spec.py: def handle_type_error(method: FuncT) -> FuncT:
    @@ src/python-common/ceph/tests/test_service_spec.py: from ceph.deployment.service_
      )
      from ceph.deployment.drive_group import DriveGroupSpec
      from ceph.deployment.hostspec import SpecValidationError
    -@@ src/python-common/ceph/tests/test_service_spec.py: def test_non_osd_services_do_not_get_default_termination_if_not_provided(spec_da
    - 
    -     spec_section = j.get('spec', {})
    -     assert 'termination_grace_period_seconds' not in spec_section
    +@@ src/python-common/ceph/tests/test_service_spec.py: def test_extra_args_handling(y, ec_args, ee_args, ec_final_args, ee_final_args):
    +         for args in spec_obj.extra_entrypoint_args:
    +             ee_res.extend(args.to_args())
    +         assert ee_res == ee_final_args
    ++
     +
     +def test_yaml_literal_string_class_represents_multiline_strings_as_literal():
     +    multiline_string = "test1\ntest2\n"
    @@ src/python-common/ceph/tests/test_service_spec.py: def test_non_osd_services_do_
     +
     +    assert dumped.startswith('|')
     +
    ++
     +def test_yaml_representer_can_handle_multiline_strings_for_export():
     +    spec_data = """
     +service_type: iscsi

How to proceed:

  • Authors (Genuine Conflicts): If this is a genuine conflict requiring manual resolution, ensure your resolution is correct. You must explain the conflict resolution in the commit message (e.g., leave the standard Git Conflicts: block intact) and include an explanation for changes.
  • Authors (Need Help?): Reach out to the Component Lead for technical guidance on complex code conflicts.
  • Component Leads (Review): Please review the Range Diff(s) above to verify the author's manual conflict resolution is correct for this release branch. If the deviation is intentional, documented, and approved then the component lead or @ceph/ceph-release-manager can bypass this check by commenting /audit override.

Be familiar with the rules and guidelines for writing backports.


🛟 Need Help?

If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.

📋 Component Lead / Release Manager

To override the audit failure, apply releng-audit-override label or comment /audit override.


⚠️ Note: Automated audit checks will be suspended on future pushes to prevent comment spam while you work.

When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.

View workflow run

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Jul 27, 2026
@github-actions github-actions Bot removed the releng-audit-fail Release engineering: failed backport verification audit. label Jul 27, 2026
@github-actions

Copy link
Copy Markdown

✅ Audit Override Applied by @batrick.

View workflow run

@batrick
batrick merged commit 6e52246 into ceph:squid Jul 27, 2026
21 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants