91 Commits

Author SHA1 Message Date
6d3b8a886e
pkglistgen: cli: Explicitly enable product-composer instead of detecting directories. 2024-06-10 10:05:42 +02:00
feb1e3f03b pkglistgen: Support working on git branches
Following scmsync syntax where a branch can be specified behind
the URL fragment hash

Co-authored-by: Fabian Vogt <fabian@ritter-vogt.de>
2024-05-29 16:43:58 +02:00
d297625fba pkglistgen: tool: decouple summary dict creation
The summary dictionary used to create summary-{scope}.txt was
previously returned by solve_project() via write_all_groups().

After c46dd3e304d8e66e5f8f6a51bfa3ebda8cba8936, solve_project()
doesn't return anything anymore, as write_all_groups() is being
invoked just after solve_project().

Thus, the "summary" dictionary would always be None.

Since the summary dict creation is generic enough, move it
to its own function, and call it afterwards after project
solving.

This commit also drops the return statement both on write_all_groups()
and write_productcompose() (where it would always return an empty
dictionary), and moves the write_productcompose() call after
solve_project() as well to match the change with write_all_groups().

Signed-off-by: Eugenio Paolantonio <eugenio.paolantonio@suse.com>
2024-05-14 11:39:24 +02:00
c120c9bc36
pkglistgen.py: Run productcomposer iif there's a *.productcompose.in file and a 000productcompose directory.
Previously pkglistgen.py assumed that a project either used
product-builder or the new product-composer, by exiting unrecoverably
when a *.productcompose.in file was found but the relative
000productcompose directory was absent.

This is not the case for SL Micro as the shared SLFO codebase is still
an hybrid OBS/git project and hence its stagings are not git based and
can't use product composer.

This patch was tested for the SUSE:ALP:Source:Standard:1.0:Staging:A and
SUSE:ALP:Products:Marble:6.0 projects (together with
https://github.com/openSUSE/openSUSE-release-tools/pull/3078). Instead
of raising an exception when the 000productcompose directory is not
found it makes a log stating that product-composer will be skipped.
2024-05-13 16:34:07 +02:00
Dirk Müller
730630f06f
Use f-strings where possible 2024-05-07 21:52:32 +02:00
c42d51bdee
avoid shell usage 2024-05-07 16:55:51 +02:00
c46dd3e304
Make it optional to have a classic product-builder setup
No more product-builder for ALP
2024-05-07 16:22:22 +02:00
f8b06f7edc
write group support status 2024-05-07 16:22:21 +02:00
cf36ceb5b8
Add support for git project handling
Automatically switches over from OBS api calls to git
when specifing a git repository on CLI
2024-05-07 16:22:21 +02:00
9b449f91cb
Initial support for productcompose files
It requires to have a "default.productcompose" file in 000package-groups
to enable support for real
2024-05-07 16:22:12 +02:00
Fabian Vogt
fc97bf7c2b pkglistgen: Don't always regenerate .changes
Change file_utils.unlink_all_except to accept globs and use it to keep
.changes.
2024-03-12 09:04:03 +01:00
a2edca4481
Merge pull request #3064 from JanZerebecki/sde-create-release-changes-now
Create .changes files for reproducible builds
2024-03-11 16:03:12 +01:00
Jan Zerebecki
57110cc66e
Create .changes files for reproducible builds
release rpm files currently do not have .changes files, but these are
needed to extract SOURCE_DATE_EPOCH for reproducible builds.

Using the time stamp of the last commit to any of the input, which is
the 000package-groups and 000update-repos source package, as the time
for the changes entry would be reproducible, however there is resistance
to that.

The other date that is related is the time of the last
source change for any input to the whole distribution, however AFAIK
this date is not cheap enough to compute for OBS-VCS. This hopefully
changes once we move to git.

However to not delay making progress with reproducible builds in
Factory, I propose this change which makes the output of this script
non-reproducible, by using the current wall-clock time. But only when
this script produced a change to be commited. The release binary rpms
will still be reproducible. We can revisit making the generated source
reproducible, later.

See https://reproducible-builds.org/ for more general information on
this topic.
2024-03-08 14:28:26 +01:00
9e328db488 Changes to avoid parallel execution issue on SLSA services
- Create custom-cache-tag for pkglistgen to enable separate cache dir
  name in case of parallel running
- Add custom-cache-tag to SLSA services
- Check for systemd service instead of process to ensure that SLSA
  services will not run in parallel
- Change pkglisgen timer to avoid overlap with relpkggen timer
2024-02-15 12:25:42 -03:00
Fabian Vogt
da0d632b77 Rewrite bs_mirrorfull as osclib component
This has multiple benefits:
* Easier to interface with the python code that calls it
* Uses the osc python interface for connection and authentication handling
* Allows to drop the bundled OBS code in the bs_copy directory
2023-11-29 16:53:58 +01:00
Enno Gotthold
4d15d19f2d
pkglistgen: Add type annotations 2022-10-13 14:46:33 +02:00
Stephan Kulow
92fad0708e Prepare applying pkglistgen diffs on staging accept
We will check if there are approved pkglistgen comments and if so, apply
them to the target. For this we need to parse the generated markdown, so
refactor both in a common class.

There diff is applied, but not yet commited in this commit
2022-03-22 09:28:02 +01:00
Stephan Kulow
fbbf357169 pkglistgen: pass the test if the comment was replied to with 'ignore'
To allow passing multiple staging projects without force accepting
(https://github.com/openSUSE/openSUSE-release-tools/issues/1833)
2022-03-19 14:03:20 +01:00
Stephan Kulow
830ec65b8f pkglistgen: Fix packages disapparing in comments 2022-03-17 13:45:20 +01:00
Stephan Kulow
bceaa53e13 pkglisten: Generate a comment for staging diffs
This is the next step towards having multiple submissions to SLE stagings
2022-03-17 11:16:06 +01:00
Stephan Kulow
0bbf3b2bdf
Merge pull request #2751 from coolo/change_reference
pkglistgen: If the groups contain a summary-staging.txt evaluate it
2022-03-15 13:44:45 +01:00
Stephan Kulow
1f85a4aef1 pkglistgen: If the groups contain a summary-staging.txt evaluate it 2022-03-15 13:42:16 +01:00
Stephan Kulow
54e1f9de6c pkglistgen: Remove very noisy debug output 2022-03-14 08:52:48 +01:00
Stephan Kulow
c8721fcb13 Fix filtering of unneeded.yml
The regexps were supposed to match package names, but re.match does not
what I thought it does - it only matches the start of the line not the
end
2022-03-11 08:08:55 +01:00
Stephan Kulow
b93adbd9c1 pkglistgen: Fix exit values - True is actually bad 2022-03-05 15:58:20 +01:00
Stephan Kulow
e3f0a13b96 pkglistgen: Don't exit 1 if we skip weakremovers due to restarted builds
Since 30daff5613803667be7422056431116e84c07d59 we check if the repos are
still what we expected them to be when we started and stop calculating
weakremovers.inc if the build didn't stay still for the full runtime of
the pkglistgen. But the exception makes it impossible to spot real
failures - so make this a regular exit
2022-03-04 13:40:29 +01:00
Stephan Kulow
7a63f0c3bd Treat all group*.yml like groups.yml
Fixes #2655
2022-03-03 16:26:03 +01:00
Stephan Kulow
33da10611b pkglistgen: Also support zstd for weakremovers.inc 2022-02-25 09:43:34 +01:00
Stephan Kulow
aaab4af930 Target F401 - Unused imports 2022-02-18 18:29:27 +01:00
Stephan Kulow
f86579642b Target E501 - Line too long
https://www.flake8rules.com/rules/E501.html - but 79 characters is a
joke
2022-02-18 18:17:27 +01:00
Stephan Kulow
f38bd3a7ed Target E128 - Continuation line under-indented for visual indent
https://www.flake8rules.com/rules/E128.html
2022-02-18 17:35:33 +01:00
Stephan Kulow
27c364b0c9 Target E251 - Unexpected spaces around keyword
https://www.flake8rules.com/rules/E251.html
2022-02-18 17:28:13 +01:00
Stephan Kulow
529d1dafae Target E302 - add two comment lines before class 2022-02-18 17:15:48 +01:00
Stephan Kulow
579145b52c Target F841 - Remove unused variables 2022-02-18 17:01:38 +01:00
Stephan Kulow
ae734ba555 Fix indent of statements E127
https://www.flake8rules.com/rules/E127.html
2022-02-18 14:23:59 +01:00
Stephan Kulow
2de74cfc52 Replace variable name 'l' (x is fine)
https://www.flake8rules.com/rules/E741.html
2022-02-18 14:21:59 +01:00
Stephan Kulow
cd161f34cd
Merge pull request #2668 from dirkmueller/use_newest_package
add option to use newest package for resolving dependencies
2021-11-05 07:56:18 +01:00
Dirk Mueller
f968110f9d add option to use newest package for resolving dependencies
In some cases we'd like to chose from all available repositories
for selecting the right package. in appliance builds and there
is an OBS-UseUnorderedRepos flag for enabling this behavior. Similarly
product-builds have a flag "use_newest_version" that can be set
to true. pkglistgen needs to know about these variant as well
to properly resolve package dependencies.
2021-11-04 20:47:23 +01:00
Stephan Kulow
0d7770bce0 pkglistgen: Skip repos without state
This happens for repos we only inherit for the project config but that
do not build for said architecture
2021-10-27 09:16:25 +02:00
Stephan Kulow
775f9a42a2 pkglistgen: Keep caching repo solv files but copy them away
Not caching them kills botmaster's performance. So we need to keep
that but try to avoid races differently by copying the files from
cachedir to local dir.
2021-10-26 18:48:10 +02:00
Stephan Kulow
30daff5613 pkglistgen: Skip relying on the global cache directory
The weakremovers.inc is still flickering and the only explanation left
is that other pipelines break the solv file during the (quite long)
runtime of the pkglistgen pipeline.

So stop relying on the solv file in the global cache directory - the
repo itself is not as dangerous, but the solv should live in the working
directory while it's running
2021-10-26 08:27:01 +02:00
Stephan Kulow
241f7a966a pkglistgen: Do not generate weakremovers if in release package mode
Technically the weakremovers.inc is part of the release package, but
it can only be calculated in the context of the full product build
2021-10-24 09:05:33 +02:00
Stephan Kulow
de699c125e pkglistgen: Accept i686 as well 2021-09-21 13:54:10 +02:00
Stephan Kulow
ad7e5f960e pkglistgen: replace if not a in with if a not in 2021-09-21 13:53:22 +02:00
Stephan Kulow
35eeb2af2b pkglistgen: Fix architecture handling of weakremovers
15.3 introduced something unexpected: aarch64, ppc64le and s390x are part
of the repos - and all architectures that aren't native to openSUSE:Factory
are considered to bear dropped packages, e.g. *all of them*

On top of that the setdefault using the same hash caused packages to come
and go for repos, creating unstable output
2021-09-21 12:29:12 +02:00
Stephan Kulow
8da0139b93 pkglistgen: Force outdir for the checkouts
Otherwise the osc config for checkout_no_colon will interfer where the
files end up and then we can't open them reliable.

Fixes #2559
2021-05-10 12:21:55 +02:00
Richard Brown
b0817c1741 Revert pkglistgen: ignore bootstrap_copy repo 2021-04-08 12:29:02 +02:00
Ludwig Nussel
e15419a753 pkglistgen: don't die on unset pkglistgen-ignore_repos 2021-04-06 15:18:26 +02:00
Stephan Kulow
6b65b00adf
Merge pull request #2539 from lnussel/master
pkglistgen: ignore bootstrap_copy repo
2021-04-06 07:55:08 +02:00
Stephan Kulow
35ff3f9e34 pkglistgen: After solving check all packages listed
If the packages are already part of the modules that are excluded
(due to dependencies), output an ERROR (which is not fatal atm)

Fixes #2541
2021-04-01 15:48:37 +02:00