-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rhel-9.3] backport fixes #19740
Merged
Merged
[rhel-9.3] backport fixes #19740
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Split the po files into po.$lang.js and po.manifest.$lang.js so the shell can only serve the translated manifests for the C bridge we now need to also load globbed manifest translations. The Python bridge does not support globbing so we need to explicitly load the po.js file as well. Closes cockpit-project#18224 Co-authored-by: Allison Karlitskaya <[email protected]> This is intrusive for rhel-9.3 branch, but field-tested by now, and allows us to cleanly backport other important fixes. Cherry-picked from 89781ba
Make several fixes to our handling of the `Accept-Language:` header: - we used to crash if `q=` contained invalid values due to an unchecked cast with `float()`. Catch that error and ignore the entry in that case. - our handling of English was incorrect. We would look for and fail to find po.en.js, and move on to the next item in the list. That means if the user listed English first, followed by another language which we did support, they'd see Cockpit in that other language, which is unexpected. This is a regression introduced by f4be906. Now we drop all items that sort after English. - our handling of fallbacks (ie: 'de' from 'de-de') was incorrect. RFC4647 §3.4 says that a "Lookup" should consider items in the order they're found, stripping each item down to its base form, before considering the next item. This passes a gut check, as well: a user who lists `de-de, nl` probably expects to see a German translation before a Dutch one. We also now mark the parser code as `@lru_cache`. This makes sense: within a given run of cockpit-bridge, we're likely to see very many copies of the Accept-Language header, and they're practically always going to be identical. Make sure we now accept and return immutable types to prevent weird side-effects. We also take the time to remove duplicate items from the list. While we're at it, up our testing game a bit to make sure we don't mistreat requests for 'English' in the future. Closes cockpit-project#19526 Cherry-picked from b6564b2 as a prerequisite for cleanly cheryy-picking important fixes.
We removed support for `.min.` filenames because we thought that nobody was using it anymore, but there are still external packages that make use of it. Add it back again, but only for the case where the non-minified version isn't present. The minified version can always be explicitly requested via its full filename (minus `.gz`, if applicable). Add a bit of debugging output and some test cases to make sure we handle the combinations properly. Fixes https://issues.redhat.com/browse/RHEL-19005 Cherry-picked from 5d00faa
This call was introduced in commit 483027a, but this API only exists since glib 2.72, while current RHEL 9.3 still has 2.68. This causes client to crash with an AttributeError. Provide a fallback implementation. https://issues.redhat.com/browse/RHEL-18989 Cherry-picked from 82c59a0
With only looking at aos-release's `ID` field, we are missing out a lot of derivatives, such as CentOS Stream, Rocky, or Debian-likes. Consider ID_LIKE as well to fix that. E.g. on Ubuntu, `ID_LIKE` is "debian", on CentOS it's "rhel fedora", on Rocky Linux it's "rhel centos fedora". Use that to clean up the manifest map, as Ubuntu and RHEL are now redundant. testBasic covers the "direct package name" case in the manifest. Add a new testOsMap test to check the distroname → packagename map that we use in real life. Cherry-picked from 7bbf916
Commit 7bbf916 introduced a major bug: If the OS in os-release was not found in the iteration, get_config() would return the whole map instead of the default value. That crashed the page with `TypeError: names.forEach is not a function`. This is awkward to do correctly with .find(), especially due to modifying `val` as a side effect; iterate over `os_list` the good old `for` way instead. This was hidden by the test's manifest override leaving `appstream_config_packages` intact, so it was always taken from the real underlying OS. Override it as well. Cherry-picked from 0eeb475
jelly
approved these changes
Dec 12, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Plus a few prerequisites and "nice to have" other fixes.