Skip to content

Conversation

pchila
Copy link
Member

@pchila pchila commented Sep 15, 2025

Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407.

There is no backport needed as the feature will be released for the first time in 9.2.0.

Edit: it seems that we need a version bump for past updates to the x-pack/plugin/core/template-resources/src/main/resources/fleet-agents.json file that did not bump the schema version (see discussion below).
If we want to use the bump included in this PR, we need to backport this to all active branches
cc @ebeahan @cmacknz @pkoutsovasilis

Add "reason" text field to map a new upgrade details field introduced in
PR elastic/elastic-agent#8407
@pchila pchila self-assigned this Sep 15, 2025
@pchila pchila added >enhancement :Core/Infra/Plugins Plugin API and infrastructure Team:Core/Infra Meta label for core/infra team Team:Fleet labels Sep 15, 2025
@elasticsearchmachine elasticsearchmachine added v9.2.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Sep 15, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticsearchmachine
Copy link
Collaborator

Hi @pchila, I've created a changelog YAML for you.

@juliaElastic
Copy link
Contributor

We should update the schema version here:

private static final int FLEET_AGENTS_MAPPINGS_VERSION = 3;

Context: #119087

@pchila pchila requested a review from a team as a code owner September 15, 2025 10:57
@pchila
Copy link
Member Author

pchila commented Sep 15, 2025

We should update the schema version here:

private static final int FLEET_AGENTS_MAPPINGS_VERSION = 3;

Context: #119087

@juliaElastic
Fixed in a1163f1

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

LGTM

@pkoutsovasilis
Copy link
Contributor

@juliaElastic 👋

I noticed that @pchila bumped FLEET_AGENTS_MAPPINGS_VERSION in this PR (after your comment), but in my previous PR #127651 (which you reviewed) where I added a new field, I didn't bump this version.

Should we retroactively bump FLEET_AGENTS_MAPPINGS_VERSION to cover those previous changes, or has this version bump only now become necessary?

@juliaElastic
Copy link
Contributor

@pkoutsovasilis AFAIK the version field should be bumped after every change, it looks like we missed it in #127651.
We should probably bump the version for the backport branches for #127651

@pkoutsovasilis
Copy link
Contributor

Actually @juliaElastic, we didn’t just miss this once — looking at the file history there are multiple commits where FLEET_AGENTS_MAPPINGS_VERSION wasn’t bumped:

If this bump was truly critical, I’d expect the missing bumps in those commits (where we added new fields) to have triggered a large number of SDHs — but I don’t think that has happened.

Just to make sure we handle this correctly going forward; are we certain this bump is strictly required for every field addition? I’d like to double-check the actual impact of missing bumps before we retroactively update all the backport branches.

cc @ebeahan @cmacknz

@juliaElastic
Copy link
Contributor

I think it's not necessarily causing an issue for every change.
If we miss bumping the version, existing deployments won't get the updated mappings on stack upgrade. It can cause a problem if we rely on the mapping for a feature, e.g. we needed the keyword mapping to use a new field for searching in space awareness feature: elastic/kibana#204834

@pkoutsovasilis
Copy link
Contributor

pkoutsovasilis commented Sep 15, 2025

It can cause a problem if we rely on the mapping for a feature, e.g. we needed the keyword mapping to use a new field for searching in space awareness feature: elastic/kibana#204834

I get that point - if we added fields that were optional or not relied upon, missing the bump wouldn’t be a big deal.
However, most of what we’ve added (looking at the commits again) is critical for parsing data correctly, so IMO every change probably deserves a bump to avoid subtle issues later.

I’ll leave it to @ebeahan @cmacknz to weigh in on the actual impact and whether we should retroactively bump in backports - I might be missing some of the fine-print details here.

@cmacknz
Copy link
Member

cmacknz commented Sep 15, 2025

I’ll leave it to @ebeahan @cmacknz to weigh in on the actual impact and whether we should retroactively bump in backports - I might be missing some of the fine-print details here.

Yes I strongly suspect missing this is the reason we've seen SDHs around the complete field at least, we never found out why it suddenly started appearing but this missing revision bump coupled with something starting to use it in the UI (perhaps synthetics UI?) would do it.

Some of the other missing updates aren't used widely yet (e.g. fips). Better safe than sorry on this.

Also this is a pretty big foot gun so it would be ideal if we can figure out some way to have this flagged in CI. I am not familiar enough with ES changes to know what to do about that or if it's even possible. I suspect that relying on this revision instead of having a diff mechanism detect the need for it is a problem.

@cmacknz
Copy link
Member

cmacknz commented Sep 15, 2025

If we want to use the bump included in this PR, we need to backport this to all active branches

My vote is we backport this PR to avoid any issues where we have the same revision number for different change sets. I'm not sure if this would be a problem but I'd rather just avoid it entirely, adding the field here is low enough risk to backport.

@pchila pchila added the v9.1.4 label Sep 15, 2025
@pchila pchila merged commit 67676ae into elastic:main Sep 15, 2025
35 checks passed
@pchila pchila added the auto-backport Automatically create backport pull requests when merged label Sep 15, 2025
ebeahan pushed a commit to ebeahan/elasticsearch that referenced this pull request Sep 15, 2025
…34711)

* Add Reason field to elastic-agent upgrade details metadata

Add "reason" text field to map a new upgrade details field introduced in
PR elastic/elastic-agent#8407

* Update docs/changelog/134711.yaml

* Bump FLEET_AGENTS_MAPPINGS_VERSION

(cherry picked from commit 67676ae)

# Conflicts:
#	x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java
@ebeahan
Copy link
Member

ebeahan commented Sep 15, 2025

💚 All backports created successfully

Status Branch Result
9.1
9.0
8.19
8.18

Questions ?

Please refer to the Backport tool documentation

ebeahan pushed a commit to ebeahan/elasticsearch that referenced this pull request Sep 15, 2025
…34711)

* Add Reason field to elastic-agent upgrade details metadata

Add "reason" text field to map a new upgrade details field introduced in
PR elastic/elastic-agent#8407

* Update docs/changelog/134711.yaml

* Bump FLEET_AGENTS_MAPPINGS_VERSION

(cherry picked from commit 67676ae)

# Conflicts:
#	x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java
ebeahan pushed a commit to ebeahan/elasticsearch that referenced this pull request Sep 15, 2025
…34711)

* Add Reason field to elastic-agent upgrade details metadata

Add "reason" text field to map a new upgrade details field introduced in
PR elastic/elastic-agent#8407

* Update docs/changelog/134711.yaml

* Bump FLEET_AGENTS_MAPPINGS_VERSION

(cherry picked from commit 67676ae)

# Conflicts:
#	x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java
elasticsearchmachine pushed a commit that referenced this pull request Sep 15, 2025
…134752)

* Add Reason field to elastic-agent upgrade details metadata

Add "reason" text field to map a new upgrade details field introduced in
PR elastic/elastic-agent#8407

* Update docs/changelog/134711.yaml

* Bump FLEET_AGENTS_MAPPINGS_VERSION

(cherry picked from commit 67676ae)

# Conflicts:
#	x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java

Co-authored-by: Paolo Chilà <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Sep 15, 2025
…134749)

* Add Reason field to elastic-agent upgrade details metadata

Add "reason" text field to map a new upgrade details field introduced in
PR elastic/elastic-agent#8407

* Update docs/changelog/134711.yaml

* Bump FLEET_AGENTS_MAPPINGS_VERSION

(cherry picked from commit 67676ae)

# Conflicts:
#	x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java

Co-authored-by: Paolo Chilà <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Sep 15, 2025
…134750)

* Add Reason field to elastic-agent upgrade details metadata

Add "reason" text field to map a new upgrade details field introduced in
PR elastic/elastic-agent#8407

* Update docs/changelog/134711.yaml

* Bump FLEET_AGENTS_MAPPINGS_VERSION

(cherry picked from commit 67676ae)

# Conflicts:
#	x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java

Co-authored-by: Paolo Chilà <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Sep 15, 2025
…134751)

* Add Reason field to elastic-agent upgrade details metadata

Add "reason" text field to map a new upgrade details field introduced in
PR elastic/elastic-agent#8407

* Update docs/changelog/134711.yaml

* Bump FLEET_AGENTS_MAPPINGS_VERSION

(cherry picked from commit 67676ae)

# Conflicts:
#	x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java

Co-authored-by: Paolo Chilà <[email protected]>
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Sep 17, 2025
…34711)

* Add Reason field to elastic-agent upgrade details metadata

Add "reason" text field to map a new upgrade details field introduced in
PR elastic/elastic-agent#8407

* Update docs/changelog/134711.yaml

* Bump FLEET_AGENTS_MAPPINGS_VERSION
@juliaElastic
Copy link
Contributor

Asked around in es-core-infra channel, there is an open ES issue to catch missing version bumps in CI: https://elasticco.atlassian.net/browse/ES-10832

gmjehovich pushed a commit to gmjehovich/elasticsearch that referenced this pull request Sep 18, 2025
…34711)

* Add Reason field to elastic-agent upgrade details metadata

Add "reason" text field to map a new upgrade details field introduced in
PR elastic/elastic-agent#8407

* Update docs/changelog/134711.yaml

* Bump FLEET_AGENTS_MAPPINGS_VERSION
sarog pushed a commit to portsbuild/elasticsearch that referenced this pull request Sep 19, 2025
…34711) (elastic#134751)

* Add Reason field to elastic-agent upgrade details metadata

Add "reason" text field to map a new upgrade details field introduced in
PR elastic/elastic-agent#8407

* Update docs/changelog/134711.yaml

* Bump FLEET_AGENTS_MAPPINGS_VERSION

(cherry picked from commit 67676ae)

# Conflicts:
#	x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java

Co-authored-by: Paolo Chilà <[email protected]>
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 :Core/Infra/Plugins Plugin API and infrastructure >enhancement external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Core/Infra Meta label for core/infra team Team:Fleet v8.18.7 v8.19.4 v9.0.7 v9.1.5 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants