Skip to content

Commit 18191c7

Browse files
authored
Merge branch 'main' into copilot/fix-1102
2 parents d174c2b + 5a76239 commit 18191c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+8085
-12709
lines changed

.buildkite/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
steps:
22
- label: Release
33
agents:
4-
image: "golang:1.24.5@sha256:14fd8a55e59a560704e5fc44970b301d00d344e45d6b914dda228e09f359a088"
4+
image: "golang:1.25.0@sha256:5502b0e56fca23feba76dbc5387ba59c593c02ccc2f0f7355871ea9a0852cebe"
55
cpu: "16"
66
memory: "24G"
77
ephemeralStorage: "20G"

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ If applicable, add screenshots to help explain your problem.
3636
- Elasticsearch Version [e.g. 7.16.0]
3737

3838
**Additional context**
39-
Add any other context about the problem here.
39+
Add any other context about the problem here. Links to specific affected code files and paths here are also extremely useful (if known).

.github/copilot-instructions.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
You will be tasked to fix an issue from an open-source repository. This is a Go based repository hosting a Terrform provider for the elastic stack (elasticsearch and kibana) APIs. This repo currently supports both [plugin framework](https://developer.hashicorp.com/terraform/plugin/framework/getting-started/code-walkthrough) and [sdkv2](https://developer.hashicorp.com/terraform/plugin/sdkv2) resources. Unless you're told otherwise, all new resources _must_ use the plugin framework.
2+
3+
4+
5+
6+
Take your time and think through every step - remember to check your solution rigorously and watch out for boundary cases, especially with the changes you made. Your solution must be perfect. If not, continue working on it. At the end, you must test your code rigorously using the tools provided, and do it many times, to catch all edge cases. If it is not robust, iterate more and make it perfect. Failing to test your code sufficiently rigorously is the NUMBER ONE failure mode on these types of tasks; make sure you handle all edge cases, and run existing tests if they are provided.
7+
8+
9+
Please see [README.md](../README.md) and the [CONTRIBUTING.md](../CONTRIBUTING.md) docs before getting started.
10+
11+
12+
# Workflow
13+
14+
## High-Level Problem Solving Strategy
15+
16+
1. Understand the problem deeply. Carefully read the issue and think critically about what is required.
17+
2. Investigate the codebase. Explore relevant files, search for key functions, and gather context.
18+
3. Develop a clear, step-by-step plan. Break down the fix into manageable, incremental steps.
19+
4. Implement the fix incrementally. Make small, testable code changes.
20+
5. Debug as needed. Use debugging techniques to isolate and resolve issues.
21+
6. Test frequently. Run tests after each change to verify correctness.
22+
7. Iterate until the root cause is fixed and all tests pass.
23+
8. Reflect and validate comprehensively. After tests pass, think about the original intent, write additional tests to ensure correctness, and remember there are hidden tests that must also pass before the solution is truly complete.
24+
25+
Refer to the detailed sections below for more information on each step.
26+
27+
## 1. Deeply Understand the Problem
28+
Carefully read the issue and think hard about a plan to solve it before coding. Your thinking should be thorough and so it's fine if it's very long. You can think step by step before and after each action you decide to take.
29+
30+
## 2. Codebase Investigation
31+
- Explore relevant files and directories.
32+
- Search for key functions, classes, or variables related to the issue.
33+
- Read and understand relevant code snippets.
34+
- Identify the root cause of the problem.
35+
- Validate and update your understanding continuously as you gather more context.
36+
37+
## 3. Develop a Detailed Plan
38+
- Outline a specific, simple, and verifiable sequence of steps to fix the problem.
39+
- Break down the fix into small, incremental changes.
40+
41+
## 4. Making Code Changes
42+
- Before editing, always read the relevant file contents or section to ensure complete context.
43+
- If a patch is not applied correctly, attempt to reapply it.
44+
- Make small, testable, incremental changes that logically follow from your investigation and plan.
45+
46+
## 5. Debugging
47+
- Make code changes only if you have high confidence they can solve the problem
48+
- When debugging, try to determine the root cause rather than addressing symptoms
49+
- Debug for as long as needed to identify the root cause and identify a fix
50+
- Use print statements, logs, or temporary code to inspect program state, including descriptive statements or error messages to understand what's happening
51+
- To test hypotheses, you can also add test statements or functions
52+
- Revisit your assumptions if unexpected behavior occurs.
53+
- You MUST iterate and keep going until the problem is solved.
54+
55+
## 6. Testing
56+
- Run tests frequently using `make test` and `make testacc`
57+
- After each change, verify correctness by running relevant tests.
58+
- If tests fail, analyze failures and revise your patch.
59+
- Write additional tests if needed to capture important behaviors or edge cases.
60+
- Ensure all tests pass before finalizing.
61+
62+
## 7. Final Verification
63+
- Confirm the root cause is fixed.
64+
- Review your solution for logic correctness and robustness.
65+
- Iterate until you are extremely confident the fix is complete and all tests pass.
66+
- Run `make lint` to ensure any linting errors have not surfaced with your changes. This task may automatically correct any linting errors, and regenerate documentation. Include any changes in your commit.
67+
68+
## 8. Final Reflection and Additional Testing
69+
- Reflect carefully on the original intent of the user and the problem statement.
70+
- Think about potential edge cases or scenarios that may not be covered by existing tests.
71+
- Write additional tests that would need to pass to fully validate the correctness of your solution.
72+
- Run these new tests and ensure they all pass.
73+
- Be aware that there are additional hidden tests that must also pass for the solution to be successful.
74+
- Do not assume the task is complete just because the visible tests pass; continue refining until you are confident the fix is robust and comprehensive.
75+
76+
## 9. Before Submitting Pull Requests
77+
- Run `make docs-generate` to update the documentation, and ensure the results of this command make it into your pull request.
78+
79+
## Repository Structure
80+
81+
**docs/** - Documentation files
82+
**data-sources/** - Documentation for Terraform data sources
83+
**guides/** - User guides and tutorials
84+
**resources/** - Documentation for Terraform resources
85+
**examples/** - Example Terraform configurations
86+
**cloud/** - Examples using the cloud to launch testing stacks
87+
**data-sources/** - Data source usage examples
88+
**resources/** - Resource usage examples
89+
**provider/** - Provider configuration examples
90+
**generated/** - Auto-generated clients from the `generate-clients` make target
91+
**alerting/** - Kibana alerting API client
92+
**connectors/** - Kibana connectors API client
93+
**kbapi/** - Kibana API client
94+
**slo/** - SLO (Service Level Objective) API client
95+
**internal/** - Internal Go packages
96+
**acctest/** - Acceptance test utilities
97+
**clients/** - API client implementations
98+
**elasticsearch/** - Elasticsearch-specific logic
99+
**fleet/** - Fleet management functionality
100+
**kibana/** - Kibana-specific logic
101+
**models/** - Data models and structures
102+
**schema/** - Connection schema definitions for plugin framework
103+
**utils/** - Utility functions
104+
**versionutils/** - Version handling utilities
105+
**libs/** - External libraries
106+
**go-kibana-rest/** - Kibana REST API client library
107+
**provider/** - Core Terraform provider implementation
108+
**scripts/** - Utility scripts for development and CI
109+
**templates/** - Template files for documentation generation
110+
**data-sources/** - Data source documentation templates
111+
**resources/** - Resource documentation templates
112+
**guides/** - Guide documentation templates
113+
**xpprovider/** - Additional provider functionality needed for Crossplane
114+
115+
## Key Guidelines
116+
* Follow Go best practices and idiomatic patterns
117+
* Maintain existing code structure and organization
118+
* Write unit tests for new functionality. Use table-driven unit tests when possible.
119+
* When creating a new Plugin Framework based resource, follow the code organisation of `internal/elasticsearch/security/system_user`
120+
* Avoid adding any extra functionality into the `utils` package, instead preferencing adding to a more specific package or creating one to match the purpose
121+
* Think through your planning first using the codebase as your guide before creating new resources and data sources
122+

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
contents: read
2424

2525
steps:
26-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
26+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2727
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
2828
with:
2929
go-version-file: 'go.mod'

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
timeout-minutes: 5
2020
steps:
21-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
21+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2222
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
2323
with:
2424
go-version-file: 'go.mod'
@@ -34,7 +34,7 @@ jobs:
3434
name: Lint
3535
runs-on: ubuntu-latest
3636
steps:
37-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
37+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
3838
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
3939
with:
4040
go-version-file: 'go.mod'
@@ -84,7 +84,7 @@ jobs:
8484
- 5601:5601
8585
options: --health-cmd="curl http://localhost:5601/api/status" --health-interval=10s --health-timeout=5s --health-retries=10
8686
fleet:
87-
image: docker.elastic.co/beats/elastic-agent:${{ matrix.version }}
87+
image: elastic/elastic-agent:${{ matrix.version }}
8888
env:
8989
SERVER_NAME: fleet
9090
FLEET_ENROLL: "1"
@@ -127,9 +127,9 @@ jobs:
127127
- '8.16.2'
128128
- '8.17.0'
129129
- '8.18.3'
130-
- '9.0.0-SNAPSHOT'
130+
- '9.0.3'
131131
steps:
132-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
132+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
133133
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
134134
with:
135135
go-version-file: 'go.mod'
@@ -157,7 +157,7 @@ jobs:
157157

158158
- id: setup-fleet
159159
name: Setup Fleet
160-
if: matrix.version == '8.10.3' || matrix.version == '8.11.4' || matrix.version == '8.12.2' || matrix.version == '8.13.4' || matrix.version == '8.14.3' || matrix.version == '8.15.5' || matrix.version == '8.16.2' || matrix.version == '8.17.0' || matrix.version == '9.0.0-SNAPSHOT'
160+
if: matrix.version == '8.10.3' || matrix.version == '8.11.4' || matrix.version == '8.12.2' || matrix.version == '8.13.4' || matrix.version == '8.14.3' || matrix.version == '8.15.5' || matrix.version == '8.16.2' || matrix.version == '8.17.0' || matrix.version == '9.0.3'
161161
run: |-
162162
make setup-kibana-fleet
163163
env:

.windsurf/rules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
* The project is a Terraform provider, written in Golang
2+
* The provider manages Elastic Stack resources
3+
* There is a mix of SDK, and plugin framework resources
4+
* New resources should be written with the Terraform plugin framework
5+
* Plugin framework resources should:
6+
* Follow the example set in /internal/elasticsearch/security/system_user
7+
* Be contained within their own module
8+
* Have the main concepts split across their own files
9+
* Include acceptance tests

CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
## [Unreleased]
22

33
- Add support for `solution` field in `elasticstack_kibana_space` resource and data source ([#1102](https://github.com/elastic/terraform-provider-elasticstack/issues/1102))
4+
- Add `slo_id` validation to `elasticstack_kibana_slo` ([#1221](https://github.com/elastic/terraform-provider-elasticstack/pull/1221))
5+
- Add `ignore_missing_component_templates` to `elasticstack_elasticsearch_index_template` ([#1206](https://github.com/elastic/terraform-provider-elasticstack/pull/1206))
6+
- Prevent provider panic when a script exists in state, but not in Elasticsearch ([#1218](https://github.com/elastic/terraform-provider-elasticstack/pull/1218))
7+
- Add `namespace` attribute to `elasticstack_kibana_synthetics_monitor` resource to support setting data stream namespace independently from `space_id` ([#1247](https://github.com/elastic/terraform-provider-elasticstack/pull/1247))
8+
9+
## [0.11.17] - 2025-07-21
10+
11+
- Add `elasticstack_apm_agent_configuration` resource ([#1196](https://github.com/elastic/terraform-provider-elasticstack/pull/1196))
412
- Add support for `timeslice_metric_indicator` in `elasticstack_kibana_slo` ([#1195](https://github.com/elastic/terraform-provider-elasticstack/pull/1195))
513
- Add `elasticstack_elasticsearch_ingest_processor_reroute` data source ([#678](https://github.com/elastic/terraform-provider-elasticstack/issues/678))
614
- Add support for `supports_agentless` to `elasticstack_fleet_agent_policy` ([#1197](https://github.com/elastic/terraform-provider-elasticstack/pull/1197))
@@ -434,8 +442,9 @@
434442
- Initial set of docs
435443
- CI integration
436444
437-
[Unreleased]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.16...HEAD
438-
[0.11.15]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.15...v0.11.16
445+
[Unreleased]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.17...HEAD
446+
[0.11.17]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.16...v0.11.17
447+
[0.11.16]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.15...v0.11.16
439448
[0.11.15]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.14...v0.11.15
440449
[0.11.14]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.13...v0.11.14
441450
[0.11.13]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.12...v0.11.13

0 commit comments

Comments
 (0)