-
Notifications
You must be signed in to change notification settings - Fork 127
Add information about test integrations automation #1351
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,26 @@ elastic-package help | |
|
|
||
| ## Development | ||
|
|
||
| Download and build the latest main of `elastic-package` binary: | ||
| Even though the project is "go-gettable", there is the [`Makefile`](./Makefile) present, which can be used to build, | ||
| install, format the source code among others. Some examples of the available targets are: | ||
|
|
||
| `make build` - build the tool source | ||
|
|
||
| `make clean` - delete elastic-package binary and build folder | ||
|
|
||
| `make format` - format the Go code | ||
|
|
||
| `make check` - one-liner, used by CI to verify if source code is ready to be pushed to the repository | ||
|
|
||
| `make install` - build the tool source and move binary to `$GOBIN` | ||
|
|
||
| `make gomod` - ensure go.mod and go.sum are up to date | ||
|
|
||
| `make update` - update README.md file | ||
|
|
||
| `make licenser` - add the Elastic license header in the source code | ||
|
|
||
| To start developing, download and build the latest main of `elastic-package` binary: | ||
|
|
||
| ```bash | ||
| git clone https://github.com/elastic/elastic-package.git | ||
|
|
@@ -61,6 +80,40 @@ git rm --cached -r . | |
| git reset --hard | ||
| ``` | ||
|
|
||
| ### Testing with integrations repository | ||
|
|
||
| While working on a new branch, it is interesting to test these changes | ||
| with all the packages defined in the [integrations repository](https://github.com/elastic/integrations). | ||
| This allows to test a much wider scenarios than the test packages that are defined in this repository. | ||
|
|
||
| This test can be triggered automatically directly from your Pull Request by adding a comment `test integrations`. Example: | ||
| - Comment: https://github.com/elastic/elastic-package/pull/1335#issuecomment-1619721861 | ||
| - Pull Request created in integrations repository: https://github.com/elastic/integrations/pull/6756 | ||
|
|
||
| This comment triggers this [Buildkite pipeline](https://github.com/elastic/elastic-package/blob/6f084e21561105ac9773acab00c3439251f111a0/.buildkite/pipeline.test-with-integrations-repo.yml) ([Buildkite job](https://buildkite.com/elastic/elastic-package-test-with-integrations)). | ||
|
|
||
| This pipeline creates a new draft Pull Request in integration updating the required dependencies to test your own changes. As a new pull request is created, a CI | ||
| job will be triggered to test all the packages defined in this repository. A new comment with the link to this new Pull Request will be posted in your package-spec Pull Request. | ||
|
|
||
| **IMPORTANT**: Remember to close this PR in the integrations repository once you close the package-spec Pull Request. | ||
|
|
||
| Usually, this process would require the following manual steps: | ||
| 1. Create your elastic-package pull request and push all your commits | ||
| 2. Get the SHA of the latest changeset of your PR: | ||
| ```bash | ||
| $ git show -s --pretty=format:%H | ||
| 1131866bcff98c29e2c84bcc1c772fff4307aaca | ||
| ``` | ||
| 3. Go to the integrations repository, and update go.mod and go.sum with that changeset: | ||
| ```bash | ||
| cd /path/to/integrations/repostiory | ||
| go mod edit -replace github.com/elastic/elastic-package=github.com/<your_github_user>/elastic-package@1131866bcff98c29e2c84bcc1c772fff4307aaca | ||
| go mod tidy | ||
| ``` | ||
| 4. Push these changes into a branch and create a Pull Request | ||
| - Creating this PR would automatically trigger a new Jenkins pipeline. | ||
|
|
||
|
|
||
| ## Commands | ||
|
|
||
| `elastic-package` currently offers the commands listed below. | ||
|
|
@@ -512,21 +565,6 @@ The following settings are available per profile: | |
| Elasticsearch in stacks managed by elastic-package. It is recommended to use | ||
| an absolute path, out of the `.elastic-package` directory. | ||
|
|
||
| ## Development | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This section was duplicated. Merged into the other Development section in line 39 |
||
|
|
||
| Even though the project is "go-gettable", there is the `Makefile` present, which can be used to build, format or vendor | ||
| source code: | ||
|
|
||
| `make build` - build the tool source | ||
|
|
||
| `make format` - format the Go code | ||
|
|
||
| `make install` - build the tool source and move binary to `$GOBIN` | ||
|
|
||
| `make vendor` - vendor code of dependencies | ||
|
|
||
| `make check` - one-liner, used by CI to verify if source code is ready to be pushed to the repository | ||
|
|
||
| ## Release process | ||
|
|
||
| This project uses [GoReleaser](https://goreleaser.com/) to release a new version of the application (semver). Release publishing | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few more targets, and change
make vendortarget by themake gomodone.