Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Aditya GS <adityags2004@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: tgamblin@baylibre.com, Aditya GS <adityags2004@gmail.com>
Subject: [PATCH v3] patchtest: warn if Upstream-Status is after patch scissors
Date: Thu, 11 Jun 2026 14:39:57 +0530	[thread overview]
Message-ID: <20260611090957.2606-1-adityags2004@gmail.com> (raw)

[YOCTO #15940]

Detect cases where Upstream-Status is placed after the patch
scissors ("---") and emit a warning instead of failing.

Such placement may be intentional in some workflows to avoid
including the tag in upstream commits.

v3:
- Fix indentation issues from previous version
- Keep changes minimal and avoid unrelated formatting changes
- Retain intended warning behavior

Signed-off-by: Aditya GS <adityags2004@gmail.com>
---
 meta/lib/patchtest/tests/test_patch.py | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/meta/lib/patchtest/tests/test_patch.py b/meta/lib/patchtest/tests/test_patch.py
index 3b33b5a199..598a2234aa 100644
--- a/meta/lib/patchtest/tests/test_patch.py
+++ b/meta/lib/patchtest/tests/test_patch.py
@@ -67,13 +67,10 @@ class TestPatch(base.Base):
 
             if not header_has_upstream:
                 if body_has_upstream:
-                    self.fail(
-                        'Upstream-Status is present only after the patch scissors. '
-                        "It must be placed in the patch header before the scissors line.",
-                        data=[
-                            ("Standard format", self.standard_format),
-                            ("Valid status", self.valid_status),
-                        ],
+                    print(
+                        "WARNING: Upstream-Status is present only after the patch scissors. "
+                        "It may be ignored by git and lost during patch refresh. "
+                        "Consider placing it before the scissors line."
                     )
                 else:
                     self.fail(
@@ -92,15 +89,12 @@ class TestPatch(base.Base):
                     continue
 
                 if scissors_index is not None and idx > scissors_index:
-                    self.fail(
-                        'Upstream-Status must be placed in the patch header before the scissors line, '
-                        "but was found afterwards.",
-                        data=[
-                            ("Current", line.lstrip("+")),
-                            ("Standard format", self.standard_format),
-                            ("Valid status", self.valid_status),
-                        ],
+                    print(
+                        "WARNING: Upstream-Status found after patch scissors. "
+                        "It may be ignored by git and lost during patch refresh. "
+                        "Consider placing it before the scissors line."
                     )
+                    continue
 
                 if patchtest_patterns.inappropriate.searchString(line):
                     try:
-- 
2.34.1



             reply	other threads:[~2026-06-11 16:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11  9:09 Aditya GS [this message]
2026-06-13 13:10 ` [OE-core] [PATCH v3] patchtest: warn if Upstream-Status is after patch scissors Alexander Kanavin
2026-06-15  5:20   ` Aditya G.S

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260611090957.2606-1-adityags2004@gmail.com \
    --to=adityags2004@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=tgamblin@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox