internal/rosa: annotate blocked updates
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m49s
Test / ShareFS (push) Successful in 3m47s
Test / Hakurei (push) Successful in 3m58s
Test / Sandbox (race detector) (push) Successful in 5m33s
Test / Hakurei (race detector) (push) Successful in 6m39s
Test / Flake checks (push) Successful in 1m22s

These situations, while unfortunate, are inevitable at a larger scale. This change enables annotation and optional hiding of blocked updates.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-30 18:56:55 +09:00
parent f4215ddda5
commit 8b87e0eb76
3 changed files with 28 additions and 1 deletions

View File

@@ -360,7 +360,10 @@ func main() {
) )
{ {
var flagJobs int var (
flagJobs int
flagNoBlock bool
)
c.NewCommand("updates", command.UsageInternal, func([]string) error { c.NewCommand("updates", command.UsageInternal, func([]string) error {
var ( var (
errsMu sync.Mutex errsMu sync.Mutex
@@ -379,6 +382,11 @@ func main() {
continue continue
} }
if !flagNoBlock && meta.Blocked != "" {
msg.Verbosef("%s is blocked: %s", meta.Name, meta.Blocked)
continue
}
v, err := meta.GetVersions(ctx) v, err := meta.GetVersions(ctx)
if err != nil { if err != nil {
errsMu.Lock() errsMu.Lock()
@@ -419,9 +427,23 @@ func main() {
&flagJobs, &flagJobs,
"j", command.IntFlag(32), "j", command.IntFlag(32),
"Maximum number of simultaneous connections", "Maximum number of simultaneous connections",
).Flag(
&flagNoBlock,
"ignore-block", command.BoolFlag(false),
"Inhibit update blocking",
) )
} }
c.NewCommand("blocked", command.UsageInternal, func([]string) error {
for _, p := range rosa.Native().CollectAll() {
meta, _ := rosa.Native().Std().Load(p)
if meta.Blocked != "" {
fmt.Printf("%s: %s\n", meta.Name, meta.Blocked)
}
}
return nil
})
c.NewCommand( c.NewCommand(
"daemon", "daemon",
"Service artifact IR with Rosa OS extensions", "Service artifact IR with Rosa OS extensions",

View File

@@ -5,6 +5,8 @@ package openssl {
// strange malformed tags treated as pre-releases in Anitya // strange malformed tags treated as pre-releases in Anitya
latest = anityaFallback; latest = anityaFallback;
block = "python";
version# = "3.6.2"; version# = "3.6.2";
source = remoteGitHubRelease { source = remoteGitHubRelease {
suffix = "openssl/openssl"; suffix = "openssl/openssl";

View File

@@ -96,6 +96,8 @@ type Metadata struct {
// //
// [Anitya]: https://release-monitoring.org/ // [Anitya]: https://release-monitoring.org/
ID int `json:"-"` ID int `json:"-"`
// Maintainer-facing reason of blocked update.
Blocked string `json:"block,omitempty"`
// Whether to exclude from exported functions. // Whether to exclude from exported functions.
Exclude bool `json:"exclude,omitempty"` Exclude bool `json:"exclude,omitempty"`
@@ -944,6 +946,7 @@ func (ctx *evalContext) pf(
k("version"): &meta.Version, k("version"): &meta.Version,
k("exclude"): &meta.Exclude, k("exclude"): &meta.Exclude,
k("anitya"): &anitya, k("anitya"): &anitya,
k("block"): &meta.Blocked,
k("latest"): &meta.latest, k("latest"): &meta.latest,
k("writable"): &attr.Writable, k("writable"): &attr.Writable,