Skip to content

Commit 067ec87

Browse files
committed
Report: Adds stability and updates READMEs
1 parent e4f4765 commit 067ec87

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

README.md

+25-6
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,41 @@ irb -r rubygems -I lib -r ./console.rb
4646
Once in the interactive shell you'll have access to the data. You can run `download_artifacts` from the console to get the latest specification files. Take a look at [`Elastic::Reporter`](./report/reporter.rb) to learn about the available functions.
4747

4848
```ruby
49-
3.3.4 :001 > @reporter.endpoints.count
49+
# Count all the endpoints
50+
> @reporter.endpoints.count
5051
=> 482
51-
3.3.4 :002 > @reporter.endpoints.first
52+
# Show first endpoint object
53+
> @reporter.endpoints.first
5254
=>
53-
#<Elastic::ApiEndpoint:0x00007f94abe7a698
54-
@availability={"serverless"=>{"stability"=>"stable", "visibility"=>"public"}, "stack"=>{"since"=>"7.7.0", "stability"=>"stable"}},
55+
#<Elastic::ApiEndpoint:0x00007f94abe7a698 @availability={"serverless"=>{"stability"=>"stable",
56+
"visibility"=>"public"}, "stack"=>{"since"=>"7.7.0", "stability"=>"stable"}} ,
5557
@available_serverless=true,
5658
@available_stack=true,
5759
@name="async_search.delete",
5860
@test_serverless={:file=>"./tests/async_search/10_basic.yml", :line=>53},
5961
@test_stack={:file=>"./tests/async_search/10_basic.yml", :line=>53}>
60-
3.3.4 :003 > @reporter.namespaces
62+
# Show available namespaces
63+
> @reporter.namespaces
6164
=>
62-
["async_search", "cat", "ccr", "cluster", "connector", "dangling_indices", "enrich", "eql", "esql",
65+
["async_search", "cat", "ccr", "cluster", "connector", "dangling_indices", "enrich", "eql", "esql",
6366
"features", "fleet", "graph", "ilm", "indices", "inference", "ingest", "license", "logstash",
6467
"migration", "ml", "monitoring", "nodes", "query_rules", "search_application",
6568
"searchable_snapshots", "security", "simulate", "slm", "synonyms", "tasks", "text_structure",
6669
"transform", "watcher", "xpack"]
70+
# Show experimental endpoints in Stack
71+
> @reporter.endpoints.select { |e| e.stability_stack == 'experimental' }.map(&:name)
72+
73+
["cat.tasks", "connector.check_in", "connector.sync_job_check_in", "connector.sync_job_claim",
74+
"connector.sync_job_error", "connector.sync_job_update_stats", "connector.update_active_filtering",
75+
"connector.update_error", "connector.update_features", "connector.update_filtering_validation",
76+
"connector.update_status", "features.reset_features", "fleet.msearch", "fleet.search",
77+
"indices.disk_usage", "indices.downsample", "indices.field_usage_stats", "inference.delete",
78+
"inference.get", "inference.inference", "inference.put", "knn_search",
79+
"nodes.clear_repositories_metering_archive", "nodes.get_repositories_metering_info",
80+
"scripts_painless_execute", "search_application.delete_behavioral_analytics",
81+
"search_application.get_behavioral_analytics", "search_application.post_behavioral_analytics_event",
82+
"search_application.put_behavioral_analytics", "search_application.render_query",
83+
"searchable_snapshots.cache_stats", "searchable_snapshots.clear_cache", "simulate.ingest",
84+
"tasks.cancel", "tasks.get", "tasks.list"]
85+
6786
```

report/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ Download the necessary files with `rake download_all`. This will download and un
1313
Run `rake report` to check the available endpoints and which ones have been tested. At the time of writing this, the script checks the `../tests` folder for ocurrences of each endpoint name. The script will generate a Markdown file in `../apis_report.md`.
1414

1515
There are three main files: `reporter.rb`, `Rakefile` and `template.erb`. The first one has the code for the `Elastic::Reporter` class. When it is initialized, it gathers all the API names from the spec (excluding names starting with `_` like `_common` and `_internal`). Then it checks for each API endpoint name, if it's being used in any of the yml files in `./tests`. The reporter is initialized in the `report` task in the Rakefile and the result is passed to the ERB template to generate the markdown file and write it to `./apis_report.md`.
16+
17+
### Interactive Console
18+
19+
Run `rake console` to open an interactive Ruby shell to access and query the data via the `@reporter` object.

report/lib/api_endpoint.rb

+8
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ def namespace
9696
end
9797
end
9898

99+
def stability_stack
100+
@availability['stack']['stability']
101+
end
102+
103+
def stability_serverless
104+
@availability['serverless']['stability']
105+
end
106+
99107
private
100108

101109
# For a given flavour (:stack or :serverless), find if there are any tests that call this endpoint.

0 commit comments

Comments
 (0)