Skip to content

Improve Flatpak-Upgrade-From handling - #6626

Merged
swick merged 2 commits into
flatpak:mainfrom
razzeee:fix/upgrade-from-header-system-helper
Apr 21, 2026
Merged

swick merged 2 commits into
flatpak:mainfrom
razzeee:fix/upgrade-from-header-system-helper

Conversation

@razzeee

@razzeee razzeee commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

This adds tests for the basic header handling.

Then tests for the headers when the ref file got removed. (fails at this point)

Then a commit to fix that case.

@swick swick left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice! A few details that should change, but looks good.

Comment thread tests/web-server.py Outdated
Comment thread tests/libtest.sh Outdated
Comment thread tests/test-upgrade-from-header.sh
Comment thread tests/update-test-matrix Outdated
@razzeee
razzeee force-pushed the fix/upgrade-from-header-system-helper branch 3 times, most recently from 141639d to a4b204c Compare April 16, 2026 13:16
@razzeee

razzeee commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

Not sure why the untouched tests fail now, but seem to work fine in main.

@swick

swick commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator
    with open(self.headers_log_file, 'a+') as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not NoneType

@razzeee
razzeee force-pushed the fix/upgrade-from-header-system-helper branch from a4b204c to 29c5ff3 Compare April 16, 2026 13:43
@swick

swick commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

commit message: the prefix should be a place/thing where changes are. So, in this case dir.

@razzeee
razzeee force-pushed the fix/upgrade-from-header-system-helper branch from 29c5ff3 to e2db30c Compare April 16, 2026 14:39
@razzeee

razzeee commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

should I also change that for the test commit?

@swick

swick commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

No, it only touches things in tests, so that's fine. Essentially whatever the "main" part of the commit is.

@swick swick added this to the 1.18 milestone Apr 16, 2026
Comment thread tests/test-upgrade-from-header.sh

@swick swick left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, but can you please always just push a proper version instead of ones with fixup commits?

@razzeee
razzeee force-pushed the fix/upgrade-from-header-system-helper branch from 397affe to f57d6eb Compare April 21, 2026 07:23
razzeee added 2 commits April 21, 2026 09:23
Add an integration test that verifies the Flatpak-Upgrade-From HTTP
header is correctly sent during update operations but absent during
fresh installs. This header is used by Flathub to distinguish updates
from new installs in download statistics.

To support the test, extend web-server.py to optionally log Flatpak-*
request headers to a separate file.
@razzeee
razzeee force-pushed the fix/upgrade-from-header-system-helper branch from f57d6eb to 56f2d42 Compare April 21, 2026 07:23
@razzeee

razzeee commented Apr 21, 2026

Copy link
Copy Markdown
Contributor Author

Reworked the commits, sorry, I'm just to used to keep the history like that.

@swick
swick added this pull request to the merge queue Apr 21, 2026
Merged via the queue into flatpak:main with commit 6dfe1ad Apr 21, 2026
11 checks passed
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.

3 participants