Skip to content
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

[ci] Add debian-12 to matrix in packaging and platform jobs #116172

Merged
merged 6 commits into from
Nov 22, 2024

Conversation

jozala
Copy link
Contributor

@jozala jozala commented Nov 4, 2024

No description provided.

@jozala jozala added >non-issue :Delivery/Build Build or test infrastructure auto-backport Automatically create backport pull requests when merged v8.17.0 labels Nov 4, 2024
@jozala jozala force-pushed the ci-pipelines-add-debian-12 branch from 0aba1c7 to 52af548 Compare November 13, 2024 10:01
@jozala jozala force-pushed the ci-pipelines-add-debian-12 branch from cd5a1ce to 1ec74c6 Compare November 20, 2024 14:39
@@ -335,7 +335,6 @@ Closure commonDebConfig(String architecture) {

// versions found on oldest supported distro, centos-6
requires('bash', '4.1', GREATER | EQUAL)
requires('lsb-base', '4', GREATER | EQUAL)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Library lsb-base is now abandoned and marked as obsolete by Lintian. This lib is not available in Debian 12.
As far as I understand it can be used for some logging function, but I couldn't find any direct calls to it from ES code.
The tests has passed on all DEB-based distributions so I assume it is safe to delete it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Presumable it's just because it brings in sysvinit-utils. @rjernst do you recall why this might be needed?

Comment on lines +53 to +68
Shell.Result result = sh.runIgnoreExitCode(
String.format(Locale.ROOT, "lintian %s %s", extraArgs, getDistributionFile(distribution()))
);
Result lintianResult = lintianParser.parse(result.stdout());
// Unfortunately Lintian overrides syntax changes between Lintian versions in a non-backwards compatible
// way, so we have to manage some exclusions outside the overrides file.
if (lintianResult.isSuccess() == false) {
List<Issue> importantIssues = lintianResult.issues()
.stream()
.filter(issue -> IGNORED_TAGS.contains(issue.tag()) == false)
.toList();
if (importantIssues.isEmpty() == false) {
fail(
"Issues for DEB package found by Lintian:\n"
+ importantIssues.stream().map(Record::toString).collect(Collectors.joining("\n"))
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of using exit code, the Lintian output is now parsed and some tags are ignored. It is needed, because in the newer version of Lintian tag mismatched-override is a "Show-Always" tag which means it cannot be suppressed.

// way, so we have to tolerate these (or maintain separate override files per lintian version).
if (helpText.contains("--suppress-tags")) {
extraArgs += " --suppress-tags malformed-override,mismatched-override";
extraArgs = "--fail-on error,warning";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lintian --fail-on requires all levels, to fail on, to be listed .

'warning' does not imply 'error'
https://manpages.debian.org/testing/lintian/lintian.1.en.html

Lintian test has been changed to parse the result instead of using exit
code. This was required, because now `mismatched-override` is
non-erasable tag which cannot be ignored for exit code.
Lintian introduced non-backward-compatible format change for overrides
file. Because of that, some overrides are now duplicated in a format for
 older versions.
Additionally, Lintian overrides file has been cleaned up to remove the
tags which are no longer failing.
Replaced the usage of `InetAddress.getLocalHost()` with
`InetAddress.getLoopbackAddress()` in the `testSlowNodeCanBeCancelled`
test to make it work on Debian 12 where `InetAddress.getLocalHost()`
may return non-existing address due to incorrectly set value in
`/etc/hosts` by GCP VM script `google_set_hostname`.
Removed redundant code that checks for specific exit codes when running
Lintian. Different versions of Lintian produces different exit codes it
 is impossible to relay on them.
@jozala jozala force-pushed the ci-pipelines-add-debian-12 branch from 5952df2 to d3b0365 Compare November 21, 2024 12:20
@jozala
Copy link
Contributor Author

jozala commented Nov 21, 2024

Periodic builds for this branch passed:

@jozala jozala marked this pull request as ready for review November 21, 2024 12:25
@jozala jozala requested a review from a team as a code owner November 21, 2024 12:25
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

@elasticsearchmachine elasticsearchmachine added the Team:Delivery Meta label for Delivery team label Nov 21, 2024
@jozala jozala requested a review from breskeby November 21, 2024 13:17
public class LintianResultParser {

private static final Logger logger = LogManager.getLogger(LintianResultParser.class);
private static final Pattern RESULT_PATTERN = Pattern.compile("(?<severity>[EW]): (?<package>\\S+): (?<tag>\\S+) (?<message>.+)");
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think I've ever used "named" regex capture groups but I think I will going forward 👍

@jozala jozala merged commit 2ac267d into elastic:main Nov 22, 2024
16 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
7.17 Commit could not be cherrypicked due to conflicts
8.x

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 116172

jozala added a commit to jozala/elasticsearch that referenced this pull request Nov 22, 2024
…116172)

Lintian test has been changed to parse the result instead of using exit
code. This was required, because now `mismatched-override` is
non-erasable tag which cannot be ignored for exit code.
Lintian introduced non-backward-compatible format change for overrides
file. Because of that, some overrides are now duplicated in a format for
 older versions.
Additionally, Lintian overrides file has been cleaned up to remove the
tags which are no longer failing.
elasticsearchmachine pushed a commit that referenced this pull request Nov 22, 2024
…#117315)

Lintian test has been changed to parse the result instead of using exit
code. This was required, because now `mismatched-override` is
non-erasable tag which cannot be ignored for exit code.
Lintian introduced non-backward-compatible format change for overrides
file. Because of that, some overrides are now duplicated in a format for
 older versions.
Additionally, Lintian overrides file has been cleaned up to remove the
tags which are no longer failing.
@jozala
Copy link
Contributor Author

jozala commented Nov 22, 2024

💚 All backports created successfully

Status Branch Result
7.17

Questions ?

Please refer to the Backport tool documentation

jozala added a commit that referenced this pull request Nov 22, 2024
Lintian test has been changed to parse the result instead of using exit
code. This was required, because now `mismatched-override` is
non-erasable tag which cannot be ignored for exit code.
Lintian introduced non-backward-compatible format change for overrides
file. Because of that, some overrides are now duplicated in a format for
 older versions.
Additionally, Lintian overrides file has been cleaned up to remove the
tags which are no longer failing.

(cherry picked from commit 2ac267d)

# Conflicts:
#	distribution/packages/src/deb/lintian/elasticsearch
#	qa/os/src/test/java/org/elasticsearch/packaging/util/LintianResultParser.java
#	qa/packaging/src/test/java/org/elasticsearch/packaging/test/DebMetadataTests.java
smalyshev pushed a commit to smalyshev/elasticsearch that referenced this pull request Nov 22, 2024
…116172)

Lintian test has been changed to parse the result instead of using exit
code. This was required, because now `mismatched-override` is
non-erasable tag which cannot be ignored for exit code.
Lintian introduced non-backward-compatible format change for overrides
file. Because of that, some overrides are now duplicated in a format for
 older versions.
Additionally, Lintian overrides file has been cleaned up to remove the
tags which are no longer failing.
elasticsearchmachine pushed a commit that referenced this pull request Nov 25, 2024
…116172) (#117336)

* [ci] Add debian-12 to matrix in packaging and platform jobs (#116172)

Lintian test has been changed to parse the result instead of using exit
code. This was required, because now `mismatched-override` is
non-erasable tag which cannot be ignored for exit code.
Lintian introduced non-backward-compatible format change for overrides
file. Because of that, some overrides are now duplicated in a format for
 older versions.
Additionally, Lintian overrides file has been cleaned up to remove the
tags which are no longer failing.

(cherry picked from commit 2ac267d)

# Conflicts:
#	distribution/packages/src/deb/lintian/elasticsearch
#	qa/os/src/test/java/org/elasticsearch/packaging/util/LintianResultParser.java
#	qa/packaging/src/test/java/org/elasticsearch/packaging/test/DebMetadataTests.java

* Spotless fix
alexey-ivanov-es pushed a commit to alexey-ivanov-es/elasticsearch that referenced this pull request Nov 28, 2024
…116172)

Lintian test has been changed to parse the result instead of using exit
code. This was required, because now `mismatched-override` is
non-erasable tag which cannot be ignored for exit code.
Lintian introduced non-backward-compatible format change for overrides
file. Because of that, some overrides are now duplicated in a format for
 older versions.
Additionally, Lintian overrides file has been cleaned up to remove the
tags which are no longer failing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged backport pending :Delivery/Build Build or test infrastructure >non-issue Team:Delivery Meta label for Delivery team v7.17.26 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants