Skip to content

Generate flatpakref files for addon/plugin refs during publish#161

Open
razzeee wants to merge 3 commits intoflatpak:masterfrom
razzeee:add-flatpakref-tests
Open

Generate flatpakref files for addon/plugin refs during publish#161
razzeee wants to merge 3 commits intoflatpak:masterfrom
razzeee:add-flatpakref-tests

Conversation

@razzeee
Copy link
Copy Markdown
Contributor

@razzeee razzeee commented Apr 15, 2026

The publish job was only generating .flatpakref files for app/ refs. Mirror the commit job's logic by also generating them for runtime/ refs that are not auto-generated sub-refs (.Debug, .Locale, .Sources, .Docs), so addons and plugins get a .flatpakref in the main repo appstream dir.

@razzeee razzeee force-pushed the add-flatpakref-tests branch 4 times, most recently from eb0a7e7 to b96b9f1 Compare April 15, 2026 11:41
The publish job was only generating .flatpakref files for app/ refs.
Mirror the commit job's logic by also generating them for runtime/ refs
that are not auto-generated sub-refs (.Debug, .Locale, .Sources, .Docs),
so addons and plugins get a .flatpakref in the main repo appstream dir.

Extract the shared predicate into should_generate_flatpakref() in
utils.rs so both jobs stay in sync from a single source of truth.
Add unit tests for both should_generate_flatpakref() and
generate_flatpakref().
@razzeee razzeee force-pushed the add-flatpakref-tests branch from b96b9f1 to 72ef200 Compare April 15, 2026 11:46
Comment thread src/jobs/utils.rs Outdated
));
}

#[test]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

all those tests for should_generate_flatpakref should really be merged

Comment thread src/jobs/utils.rs Outdated
/// **Both the commit job and the publish job use this predicate** to decide which refs get a
/// `.flatpakref` file.
pub fn should_generate_flatpakref(ref_name: &str) -> bool {
let unwanted_exts = [".Debug", ".Locale", ".Sources", ".Docs"];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this should be const &[&str; 4] as those never change

@razzeee razzeee force-pushed the add-flatpakref-tests branch from 8a9c997 to ef6f98c Compare April 15, 2026 13:43
@razzeee razzeee requested a review from bilelmoussaoui April 15, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants