Skip to content

artifacts manifest update age, snapshot date #440

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

Merged
merged 5 commits into from
Oct 12, 2023
Merged

artifacts manifest update age, snapshot date #440

merged 5 commits into from
Oct 12, 2023

Conversation

intxgo
Copy link
Contributor

@intxgo intxgo commented Oct 5, 2023

Change Summary

Add artifact snapshot date indicator. When artifacts are not pinned to any specific snapshot date the keyword 'latest' is used.

Add artifact up-to-date age indicator. It's equal to number of days since the local artifacts copy at Endpoint side was last time deemed up-to-date (the date when either Endpoint updated the artifacts or verified that it's artifacts are up-to-date with Elastic CDN).

Note, when artifacts are pinned to a specific snapshot date, the age always equal to the numbers of days since that date. In addition the initial artifacts shipped with the installation package age is equal to the number of days since the package creation date (endpoint build date).

Sample values

Artifacts made or verified to be up-to-date today:
"Endpoint.policy.applied.artifacts.global.update_age": 0
Artifacts 50 days old
"Endpoint.policy.applied.artifacts.global.update_age": 50

Artifacts pinned to 2023-09-26 snapshot date:
"Endpoint.policy.applied.artifacts.global.snapshot": "2023-09-26"

Artifacts not pinned to any snapshot date:
"Endpoint.policy.applied.artifacts.global.snapshot": "latest"

Sample document:

Endpoint altert and Endpoint policy response:

{
    "Endpoint": {
        "policy": {
            "applied": {
                "artifacts": {
                    "global": {
                        "update_age": 0,
                        "snapshot": "latest",
                    },
}

Release Target

Q/A

For mapping changes:

  • I ran make after making the schema changes, and committed all changes
  • If these field(s) are "exception"-able, I made a companion PR to Kibana adding it (see Readme)
  • If this is a metadata change, I also updated both transform destination schemas to match

For Transform changes:

  • The new transform successfully starts in Kibana
  • The corresponding transform destination schema was updated if necessary

@intxgo intxgo requested a review from a team as a code owner October 5, 2023 11:24
@intxgo intxgo requested review from joeypoon and parkiino October 5, 2023 11:24
@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 5, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-10-12T14:11:49.260+0000

  • Duration: 7 min 3 sec

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@intxgo
Copy link
Contributor Author

intxgo commented Oct 5, 2023

@pzl @ferullo I've retargeted the PR against main and added make generated files.

@pzl
Copy link
Member

pzl commented Oct 5, 2023

Changes look good; can you please add the sample value to:

package/endpoint/data_stream/alerts/sample_event.json and package/endpoint/data_stream/policy/sample_event.json?

…json and package/endpoint/data_stream/policy/sample_event.json
@intxgo
Copy link
Contributor Author

intxgo commented Oct 5, 2023

Changes look good; can you please add the sample value to:

package/endpoint/data_stream/alerts/sample_event.json and package/endpoint/data_stream/policy/sample_event.json?

done, thanks

@intxgo intxgo changed the title Lesio/update age artifacts manifest update age, snapshot date Oct 9, 2023
@intxgo intxgo added the v8.11.0 label Oct 10, 2023
@intxgo
Copy link
Contributor Author

intxgo commented Oct 12, 2023

is there anything else I should do for this PR to make it reviewable?

@intxgo intxgo enabled auto-merge (squash) October 12, 2023 11:45
@intxgo
Copy link
Contributor Author

intxgo commented Oct 12, 2023

can anyone advise me if the remaining two Required checks are going to resolve itself with time or could I do anything to help it? I don't see any documentation in the repo how to deal with it.

@kevinlog
Copy link
Contributor

/test

@kevinlog
Copy link
Contributor

@intxgo - I'm seeing to following in the build logs:

05:24:00  FAILURE DETAILS:
05:24:00  endpoint/alerts Verify sample_event.json:
05:24:00  [0] field "Endpoint.policy.applied.artifacts.user.update_age" is undefined
05:24:00  [1] field "Endpoint.policy.applied.artifacts.user.snapshot" is undefined

it looks like the names should contain global, i.e. Endpoint.policy.applied.artifacts.global.snapshot. Could you check the sample doc again for alerts?

@intxgo intxgo merged commit b702e46 into main Oct 12, 2023
@intxgo intxgo deleted the lesio/update-age branch October 12, 2023 14:22
pzl pushed a commit that referenced this pull request Nov 6, 2023
* global artifacts update age

* adds make generated files

* add sample value to package/endpoint/data_stream/alerts/sample_event.json and package/endpoint/data_stream/policy/sample_event.json

* snapshot date
@elasticmachine
Copy link
Contributor

Package endpoint - 8.11.1 containing this change is available at https://epr.elastic.co/search?package=endpoint

pzl pushed a commit that referenced this pull request Dec 11, 2023
* global artifacts update age

* adds make generated files

* add sample value to package/endpoint/data_stream/alerts/sample_event.json and package/endpoint/data_stream/policy/sample_event.json

* snapshot date
@elasticmachine
Copy link
Contributor

Package endpoint - 8.12.0 containing this change is available at https://epr.elastic.co/search?package=endpoint

@elasticmachine
Copy link
Contributor

Package endpoint - 8.13.0 containing this change is available at https://epr.elastic.co/search?package=endpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants