Skip to content

[8.19] [Share] Add unused url cleanup task (#220138) #224442

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

Conversation

kowalczyk-krzysztof
Copy link
Member

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
share 72 104 +32

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
taskManager 10 11 +1
Unknown metric groups

API count

id before after diff
share 135 167 +32

ESLint disabled line counts

id before after diff
share 14 12 -2

Total ESLint disabled count

id before after diff
share 16 14 -2

kowalczyk-krzysztof and others added 3 commits June 18, 2025 19:49
## Summary
This PR adds a background task to `share` plugin which periodically
deletes saved objects of type `url` which have been older than a value
controlled by `share.url_expiration.duration` config - the default is 1
year.
The task can be run manually by calling `POST
/internal/unused_urls_task/run` with `superuser` privileges.

Config options (with their default values):

```yaml
share.url_expiration.enabled: false # controls whether the task is enabled
share.url_expiration.duration: '1y' # controls the expiration threshold
share.url_expiration.check_interval: '7d' # controls how often the task runs
share.url_expiration.url_limit: 10000 # controls how many urls should be fetched at once
```

Closes: elastic#179146

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 5c441a4)

# Conflicts:
#	.github/CODEOWNERS
#	src/platform/plugins/shared/share/kibana.jsonc
#	src/platform/plugins/shared/share/tsconfig.json
@kowalczyk-krzysztof kowalczyk-krzysztof merged commit 80f6aa1 into elastic:8.19 Jun 18, 2025
8 checks passed
@kowalczyk-krzysztof kowalczyk-krzysztof deleted the backport/8.19/pr-220138 branch August 1, 2025 12:28
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.

4 participants