Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ jobs:
cache-key: flatpak-devel-${{ matrix.arch }}-${{ hashFiles('Cargo.lock') }}
# The image is built on the linter's own. Only the findings in
# lint-exceptions.json may remain. The repository is not linted: its
# screenshot checks need images mirrored from the release tag.
# screenshot checks need the mirror only Flathub's build makes.
- name: Lint the manifest
if: ${{ !cancelled() && matrix.arch == 'x86_64' }}
run: |
Expand Down
1 change: 1 addition & 0 deletions linux/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build-aux/source-commit export-subst
8 changes: 6 additions & 2 deletions linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,12 @@ for the review and migration checks.

### Screenshots

The metainfo lists the PNGs in `data/screenshots` at the release tag's
URL, so a catalogue fetches the ones of the version it lists.
The metainfo lists the PNGs in `data/screenshots` at the URL of the
commit a release tarball holds, so a catalogue fetches the ones of the
version it lists. `git archive` writes that commit into
`build-aux/source-commit`; a release is built before its tag exists, and
`appstreamcli compose` drops a screenshot it cannot download. A build
from a git checkout names the release tag instead.

Take new ones from the app at default settings (light style, blue accent,
Adwaita Sans and Adwaita Mono at 11 pt, scale 1) with a 1000×700 window,
Expand Down
9 changes: 8 additions & 1 deletion linux/build-aux/packaging/flatpak-test-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# second, so an installed app has an update to take, and
# <output dir>/bundles/<branch> the bundles of the first commit. It also
# validates the desktop entry, the metainfo and the schema each app commit
# installs.
# installs, and checks that its catalogue lists every screenshot.
#
# --install-deps first installs, as root in a throwaway Ubuntu, the tools
# this needs.
Expand Down Expand Up @@ -65,6 +65,13 @@ for ref in $(ostree refs --repo="$work/repo" | grep "^app/$app/"); do
desktop-file-validate "$tree/files/share/applications/$app.desktop"
appstreamcli validate --no-net "$tree/files/share/metainfo/$app.metainfo.xml"
glib-compile-schemas --strict --dry-run "$tree/files/share/glib-2.0/schemas"
# appstreamcli compose drops a screenshot it cannot download.
named="$(grep -c '<screenshot[ >]' "$tree/files/share/metainfo/$app.metainfo.xml")"
listed="$(gzip -dc "$tree/files/share/app-info/xmls/$app.xml.gz" | grep -c '<screenshot[ >]' || true)"
if [ "$listed" -ne "$named" ]; then
echo "flatpak-test-site.sh: the catalogue of $ref lists $listed of the metainfo's $named screenshots" >&2
exit 1
fi
done

commit "$@"
Expand Down
1 change: 1 addition & 0 deletions linux/build-aux/source-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$Format:%H$
1 change: 1 addition & 0 deletions linux/changelog.d/4152.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The software center listing says TablePro works without an account or a license, and when it asks you to buy one.
1 change: 1 addition & 0 deletions linux/changelog.d/4152.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Software centers showed no screenshots for TablePro from the TablePro Flatpak repository.
10 changes: 9 additions & 1 deletion linux/crates/app/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::process::ExitCode;
mod metainfo_release;

const METAINFO_TEMPLATE: &str = "../../data/app.tablepro.TablePro.metainfo.xml.in.in";
const SOURCE_COMMIT: &str = "../../build-aux/source-commit";
/// The fallback `config::APP_ID` takes when Meson sets nothing.
const DEFAULT_APP_ID: &str = "app.tablepro.TablePro.Devel";

Expand Down Expand Up @@ -67,17 +68,24 @@ fn render_metainfo() -> Result<PathBuf, String> {

fn render_template() -> Result<String, String> {
println!("cargo::rerun-if-changed={METAINFO_TEMPLATE}");
println!("cargo::rerun-if-changed={SOURCE_COMMIT}");
println!("cargo::rerun-if-env-changed=TABLEPRO_APP_ID");
let app_id = env::var("TABLEPRO_APP_ID").unwrap_or_else(|_| DEFAULT_APP_ID.to_owned());
let package = env::var("CARGO_PKG_NAME").map_err(|error| format!("CARGO_PKG_NAME: {error}"))?;
let template = fs::read_to_string(METAINFO_TEMPLATE)
.map_err(|error| format!("could not read {METAINFO_TEMPLATE}: {error}"))?;
let source_commit =
fs::read_to_string(SOURCE_COMMIT).map_err(|error| format!("could not read {SOURCE_COMMIT}: {error}"))?;
let version = metainfo_release::newest_release(&template)
.ok_or_else(|| format!("{METAINFO_TEMPLATE} lists no release with a version"))?;
let rendered = template
.replace("@app-id@", &app_id)
.replace("@gettext-package@", &package)
.replace("@version@", &metainfo_release::tag_version(version));
.replace("@version@", &metainfo_release::tag_version(version))
.replace(
"@screenshots-ref@",
&metainfo_release::screenshots_ref(&source_commit, version),
);
if let Some(name) = unfilled_placeholder(&rendered) {
return Err(format!(
"{METAINFO_TEMPLATE} uses @{name}@, which build.rs does not fill"
Expand Down
15 changes: 11 additions & 4 deletions linux/crates/app/src/application/about_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ mod tests {
use gtk4 as gtk;

use super::*;
use crate::application::metainfo_release::{newest_release, tag_version};
use crate::application::metainfo_release::{newest_release, screenshots_ref, tag_version};

/// The text between the element `open` starts and the next `close`.
fn metainfo_text<'a>(xml: &'a str, open: &str, close: &str) -> &'a str {
Expand Down Expand Up @@ -124,10 +124,17 @@ mod tests {
#[test]
fn embedded_metainfo_pins_project_links_to_the_release_tag() {
let xml = embedded_metainfo();
let version = tag_version(newest_release(&xml).expect("the metainfo lists a release"));
let release = newest_release(&xml).expect("the metainfo lists a release");
let version = tag_version(release);
let tree = format!("https://github.com/TableProApp/TablePro/blob/linux-v{version}/linux");
let screenshots =
format!("https://raw.githubusercontent.com/TableProApp/TablePro/linux-v{version}/linux/data/screenshots/");
let source_commit = std::fs::read_to_string(
std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../build-aux/source-commit"),
)
.expect("build-aux/source-commit is in the source tree");
let screenshots = format!(
"https://raw.githubusercontent.com/TableProApp/TablePro/{}/linux/data/screenshots/",
screenshots_ref(&source_commit, release)
);
let releases = metainfo_text(&xml, "<releases", "</releases>");

assert_eq!(
Expand Down
16 changes: 16 additions & 0 deletions linux/crates/app/src/application/metainfo_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ pub(crate) fn tag_version(release: &str) -> String {
release.replacen('~', "-", 1)
}

// git archive writes the commit into build-aux/source-commit (export-subst), and a release
// is built before its tag exists; a git checkout keeps the `$Format:%H$` placeholder.
pub(crate) fn screenshots_ref(source_commit: &str, release: &str) -> String {
match source_commit.trim() {
placeholder if placeholder.starts_with('$') => format!("linux-v{}", tag_version(release)),
commit => commit.to_owned(),
}
}

fn attribute<'a>(attributes: &'a str, name: &str) -> Option<&'a str> {
let mut rest = attributes;
loop {
Expand Down Expand Up @@ -67,6 +76,13 @@ mod tests {
assert_eq!(tag_version("0.1.0"), "0.1.0");
}

#[test]
fn screenshots_name_the_archived_commit_or_the_tag() {
let commit = "3723a6c4cd9e17e1c8c641127b4d37c4f759e625";
assert_eq!(screenshots_ref(&format!("{commit}\n"), "0.1.0~beta.3"), commit);
assert_eq!(screenshots_ref("$Format:%H$\n", "0.1.0~beta.3"), "linux-v0.1.0-beta.3");
}

#[test]
fn a_release_without_a_version_names_none() {
assert_eq!(newest_release("<releases></releases>"), None);
Expand Down
19 changes: 13 additions & 6 deletions linux/data/app.tablepro.TablePro.metainfo.xml.in.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2026 TablePro Authors -->
<component type="desktop-application">
<id>@app-id@</id>
<metadata_license>CC0-1.0</metadata_license>
Expand All @@ -21,6 +22,12 @@
<li>Verify TLS, keep connections read-only, and reconnect on drop</li>
<li>Export results to CSV, JSON, SQL, Excel, Markdown, HTML and XML</li>
</ul>
<p>
TablePro works fully without an account or a license. A license covers 3
devices at a time, Mac or Linux. From the 30th day you use TablePro
without one, a message in the window asks you to buy one, at most once
every 90 days.
</p>
</description>
<launchable type="desktop-id">@app-id@.desktop</launchable>
<developer id="app.tablepro">
Expand All @@ -39,19 +46,19 @@
</branding>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/TableProApp/TablePro/linux-v@version@/linux/data/screenshots/01-table.png</image>
<image>https://raw.githubusercontent.com/TableProApp/TablePro/@screenshots-ref@/linux/data/screenshots/01-table.png</image>
<caption>Browse and edit table rows</caption>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/TableProApp/TablePro/linux-v@version@/linux/data/screenshots/02-editor.png</image>
<image>https://raw.githubusercontent.com/TableProApp/TablePro/@screenshots-ref@/linux/data/screenshots/02-editor.png</image>
<caption>Run SQL in the editor</caption>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/TableProApp/TablePro/linux-v@version@/linux/data/screenshots/03-structure.png</image>
<image>https://raw.githubusercontent.com/TableProApp/TablePro/@screenshots-ref@/linux/data/screenshots/03-structure.png</image>
<caption>Change a table's columns and indexes</caption>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/TableProApp/TablePro/linux-v@version@/linux/data/screenshots/04-connect.png</image>
<image>https://raw.githubusercontent.com/TableProApp/TablePro/@screenshots-ref@/linux/data/screenshots/04-connect.png</image>
<caption>Connect through an SSH tunnel</caption>
</screenshot>
</screenshots>
Expand Down Expand Up @@ -80,8 +87,8 @@
</description>
</agreement_section>
</agreement>
<!-- A signed-in account reaches TablePro's account service, usage data goes to PostHog once the user
chooses to share it, and a toast asks about buying a license. -->
<!-- Usage data goes to PostHog unless the user turns it off, a signed-in account reaches TablePro's
account service, and a toast asks about buying a license. -->
<content_rating type="oars-1.1">
<content_attribute id="social-info">moderate</content_attribute>
<content_attribute id="money-purchasing">mild</content_attribute>
Expand Down
11 changes: 11 additions & 0 deletions linux/data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ substitutions.set('bindir', bindir)
substitutions.set('gettext-package', meson.project_name())
substitutions.set('version', meson.project_version())

# git archive writes the commit into source-commit (export-subst), and a
# release is built before its tag exists: appstreamcli compose drops a
# screenshot whose URL names the tag. A git checkout keeps the tag's URL.
fs = import('fs')
source_commit = fs.read(meson.project_source_root() / 'build-aux' / 'source-commit').strip()
if source_commit.startswith('$')
substitutions.set('screenshots-ref', 'linux-v' + meson.project_version())
else
substitutions.set('screenshots-ref', source_commit)
endif

desktop_file_in = configure_file(
input: 'app.tablepro.TablePro.desktop.in.in',
output: application_id + '.desktop.in',
Expand Down
7 changes: 7 additions & 0 deletions linux/docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ If the notice offers an earlier tested version, link its exact release and packa

[ADR 0041, Context](decisions/0041-beta-repositories-and-release-packages.md#context) amends the older permission-policy history in ADRs 0008 and 0018. Passing the linter is not permission approval. A maintainer writes the manifest and submission by hand, discloses AI-assisted material as required, and obtains Flathub's permission review under its [current requirements](https://docs.flathub.org/docs/for-app-authors/requirements). A new app enters stable before it can use Flathub beta.

The app's own files also need a maintainer before the submission:

- **Translations.** The AI disclosure names each catalogue in `po/LINGUAS` that an agent translated (Requirements, Generative AI policy). The Localisation policy's bar on machine-generated translations is about the English localisation.
- **Screenshots.** Retake any whose window changed since `data/screenshots` was taken (MetaInfo guidelines, Quality guidelines, Screenshots, Up to date; [README.md](../README.md#screenshots)).
- **Licensing.** The metainfo description's last paragraph states what a license gives and when the app asks for one. A change to either changes it in the same release (Requirements, Monetisation policy).
- **Verification.** Flathub verifies the app through `tablepro.app` once it is listed (Quality guidelines, Managed by app author).

Our existing installs keep their TablePro origin. Adding Flathub or changing the default branch does not migrate that origin. Before offering migration instructions, test an explicit origin change from both our stable and beta installs to the accepted Flathub app. Record the commands and before/after origin, branch and commit from `flatpak info`. Verify updates come from Flathub, secrets still load, saved work survives and rollback works. Keep our repository available until that tested migration is published. Do not promise automatic migration.

## The first release
Expand Down
11 changes: 11 additions & 0 deletions linux/po/vi.po
Original file line number Diff line number Diff line change
Expand Up @@ -10259,6 +10259,17 @@ msgstr ""
msgid "Export results to CSV, JSON, SQL, Excel, Markdown, HTML and XML"
msgstr "Xuất kết quả sang CSV, JSON, SQL, Excel, Markdown, HTML và XML"

#: data/app.tablepro.TablePro.metainfo.xml.in.in
msgid ""
"TablePro works fully without an account or a license. A license covers 3 "
"devices at a time, Mac or Linux. From the 30th day you use TablePro without "
"one, a message in the window asks you to buy one, at most once every 90 days."
msgstr ""
"TablePro hoạt động đầy đủ mà không cần tài khoản hay giấy phép. Một giấy phép"
" dùng được trên 3 thiết bị cùng lúc, Mac hoặc Linux. Từ ngày thứ 30 bạn dùng "
"TablePro mà chưa có giấy phép, một thông báo trong cửa sổ sẽ đề nghị bạn mua,"
" nhiều nhất 90 ngày một lần."

#: data/app.tablepro.TablePro.metainfo.xml.in.in
msgid "Browse and edit table rows"
msgstr "Duyệt và sửa các dòng của bảng"
Expand Down
Loading