public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/rpkg] 1.70-1: Accept auto-generated sources in pre-push checks
Date: Mon, 10 Aug 2026 21:44:49 GMT	[thread overview]
Message-ID: <178639828996.1.10955081994150235090.rpms-rpkg-1d7536697f2e@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rpkg
Branch : 1.70-1
Commit : 1d7536697f2e7501872907303c364255a130dc56
Author : Lubomír Sedlář <lsedlar@redhat.com>
Date   : 2025-10-17T09:25:58+02:00
Stats  : +82/-0 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/rpkg/c/1d7536697f2e7501872907303c364255a130dc56?branch=1.70-1

Log:
Accept auto-generated sources in pre-push checks

---
diff --git a/757.patch b/757.patch
new file mode 100644
index 0000000..1e64c66
--- /dev/null
+++ b/757.patch
@@ -0,0 +1,82 @@
+From 0a2a54318ef5f57142a8fab05370e6824b0645da Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Oct 13 2025 09:59:52 +0000
+Subject: Accept auto-generated sources in pre-push checks
+
+
+The patch-git tool creates source files during spec file parsing.
+
+<https://gitlab.com/redhat/centos-stream/rpms/glibc/-/blob/c10s/patch-git.lua>
+
+With this change, the pre-push check recognizes the "auto-generated-/"
+source file prefix, so that patch-git can use it to bypass the check.
+(The rpmbuild tool ignores directory names.)
+
+Signed-off-by: Florian Weimer <fweimer@redhat.com>
+
+---
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index a4e8b23..ee74fdc 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -4617,6 +4617,13 @@ class Commands(object):
+             match = SpecFile.sourcefile_expression.match(line)
+             if match:
+                 file_location = match.group('val')
++                if file_location.startswith('auto-generated/'):
++                    # This source file is auto-generated during SRPM
++                    # construction.  It is not expected to be listed
++                    # in source/checked into Git.  Skip it for the
++                    # pre-push check.
++                    continue
++
+                 # find out the format of the source file path. From URL use just the file name.
+                 # We want to keep hierarchy of the files if possible
+                 res = urllib.parse.urlparse(file_location)
+diff --git a/tests/commands/test_pre_push_check.py b/tests/commands/test_pre_push_check.py
+index 0e9aaf7..df7d2b4 100644
+--- a/tests/commands/test_pre_push_check.py
++++ b/tests/commands/test_pre_push_check.py
+@@ -105,3 +105,40 @@ Patch3: d.patch
+         with open('sources', 'r') as f:
+             expected_sources_content = f.read().strip()
+         self.assertEqual(expected_sources_content, sources_content)
++
++    def test_push_is_not_blocked_with_autogenerated_sources(self):
++        """
++        Check that auto-generated/ source lines in the spec file
++        do not result in push failures.
++        """
++        # Track SPEC and a.patch in Git.
++        spec_file = self.module + ".spec"
++        with open(spec_file, 'w') as f:
++            f.write(SPECFILE_TEMPLATE % '''Patch0: a.patch
++Patch2: c.patch
++Source1: auto-generated/patch-git-generated-commit.txt
++''')
++
++        for patch_file in ('a.patch', 'c.patch',
++                           'patch-git-generated-commit.txt'):
++            with open(patch_file, 'w') as f:
++                f.write(patch_file)
++
++        # Track c.patch in sources
++        sources_file = SourcesFile(self.cmd.sources_filename,
++                                   self.cmd.source_entry_type)
++        file_hash = self.cmd.lookasidecache.hash_file('c.patch')
++        sources_file.add_entry(self.cmd.lookasidehash, 'c.patch', file_hash)
++        sources_file.write()
++
++        self.cmd.repo.index.add([spec_file, 'a.patch', 'sources'])
++        self.cmd.repo.index.commit('add SPEC and patches')
++
++        # The test attempts to connect to the lookaside cache.
++
++        def patch_remote_file_exists_head(name, filename, hash, hashtype):
++            return filename == 'c.patch'
++
++        with patch.object(self.cmd.lookasidecache, 'remote_file_exists_head',
++                          patch_remote_file_exists_head):
++            self.cmd.pre_push_check("HEAD")
+

             reply	other threads:[~2026-08-10 21:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10 21:44  [this message]
2026-08-10 21:44 [rpms/rpkg] 1.70-1: Accept auto-generated sources in pre-push checks 
2026-08-10 21:44 

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=178639828996.1.10955081994150235090.rpms-rpkg-1d7536697f2e@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /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