Skip to content

Conversation

seanzatzdev
Copy link
Contributor

  • Adds creationDate to SamplingConfiguration
  • User generated creation dates are rejected.
  • Adds a human readable field for the creation date to the XContent representation

@seanzatzdev seanzatzdev requested a review from Copilot October 11, 2025 00:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds timestamp tracking functionality to SamplingConfiguration by introducing a creationDate field that automatically records when configurations are created, while preventing users from manually setting creation dates.

  • Adds a creationDate field to the SamplingConfiguration record with automatic timestamp generation
  • Implements validation to reject user-provided creation dates via context-aware parsing
  • Updates serialization methods to include the new creationDate field

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
SamplingConfiguration.java Adds creationDate field, updates constructors, parsing logic, and serialization methods
RestPutSampleConfigurationAction.java Updates to use user-data aware parsing method to prevent manual creation date setting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

seanzatzdev and others added 2 commits October 10, 2025 20:44
…mpling/SamplingConfiguration.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@seanzatzdev seanzatzdev requested a review from Copilot October 11, 2025 00:52
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@seanzatzdev seanzatzdev marked this pull request as ready for review October 13, 2025 03:28
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Oct 13, 2025
@seanzatzdev seanzatzdev added :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >non-issue and removed needs:triage Requires assignment of a team area label labels Oct 13, 2025
@seanzatzdev seanzatzdev requested a review from masseyke October 13, 2025 03:29
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Oct 13, 2025
@seanzatzdev seanzatzdev requested a review from Copilot October 13, 2025 14:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

# Conflicts:
#	server/src/test/java/org/elasticsearch/action/admin/indices/sampling/SamplingConfigurationTests.java
ObjectParser.ValueType.LONG
);
PARSER.declareString(optionalConstructorArg(), new ParseField(CONDITION_FIELD_NAME));
PARSER.declareField(optionalConstructorArg(), (p, c) -> {
Copy link
Member

Choose a reason for hiding this comment

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

You can just delete this (and adjust the array index of rawCreationTime above), right? It doesn't seem to actually be used.

Copy link
Member

Choose a reason for hiding this comment

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

Oh I see it does make for a more meaningful user error message when they try to set creation_time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, but also since we're using builder.timestampFieldsFromUnixEpochMillis(), it can lead to some weird errors if you don't add parsing instructions for both the raw and human readable fields. so i just added parsing instructions + ignored the human readable one up above

Copy link
Member

@masseyke masseyke left a comment

Choose a reason for hiding this comment

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

I left a couple of minor comments, but LGTM

@seanzatzdev seanzatzdev enabled auto-merge (squash) October 13, 2025 18:54
elasticsearchmachine and others added 2 commits October 13, 2025 18:58
# Conflicts:
#	server/src/test/java/org/elasticsearch/action/admin/indices/sampling/SamplingConfigurationTests.java
@seanzatzdev seanzatzdev merged commit 0caaf78 into elastic:main Oct 13, 2025
34 checks passed
@seanzatzdev seanzatzdev deleted the ttl-in-config branch October 13, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >non-issue Team:Data Management Meta label for data/management team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants