Skip to content
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

Remote Zip URL support for heartbeat synthetics #271

Closed
andrewvc opened this issue Nov 10, 2020 · 5 comments · Fixed by elastic/beats#23467 or elastic/beats#24714
Closed

Remote Zip URL support for heartbeat synthetics #271

andrewvc opened this issue Nov 10, 2020 · 5 comments · Fixed by elastic/beats#23467 or elastic/beats#24714
Assignees
Labels
enhancement New feature or request test-plan-ok Indicates an issue has been tested for release v7.13.0

Comments

@andrewvc
Copy link
Contributor

andrewvc commented Nov 10, 2020

Is your feature request related to a problem? Please describe.

Today users need to use some custom process of their own design to move files onto the same machine as heartbeat for synthetic suites. This won't work for cloud and is a waste of effort given that most people can / will use git.

Describe the solution you'd like

We should make it possible for heartbeat to download remote zip files (authenticated via basic auth / TLS). The syntax could be as simple as:

synthetic_suites:
- type: git
  url: https://github.com/elastic/synthetics/archive/master.zip
  username: myuser
  password: mypassword
  directory: examples
@vigneshshanmugam
Copy link
Member

Thanks Andrew for kick starting this issue. Totally 💯 to the approach and we would need this to improve the DX. Just one idea, may be we can use api tokens instead of the username and password fields, one advantage is that the users can limit the scope of the tokens (read_repo, write_repo, etc.).

@paulb-elastic
Copy link

We had a discussion about this earlier, considering that the initial version might be best to get the suite files from an HTTP endpoint (e.g. ZIP download), as opposed to a git clone. This still delivers value in being able to get the suite assets on demand when the test runs, with the following benefits:

  • Don’t need to download the git repository
    • There may be security concerns from users (even with the option to limit the folder to download), as the credentials/token could still potentially be used to download the full repository)
  • Can use an HTTP HEAD request to identify if the asset has been updated since the last download
  • The suite assets (that would be downloaded via HTTP) could be staged as part of the users’ build pipeline

@andrewvc andrewvc changed the title Git support for heartbeat synthetics Remote Zip URL support for heartbeat synthetics Nov 10, 2020
@andrewvc
Copy link
Contributor Author

@paulb-elastic I've updated the issue description to reflect the move to Zip over HTTP from git.

@andrewvc andrewvc reopened this Mar 23, 2021
andrewvc added a commit to elastic/beats that referenced this issue Apr 23, 2021
Adds support for remote zips to browser monitors, letting users just automatically pull from a remote repo.

Fixes elastic/uptime#271
@zube zube bot added the [zube]: Done label Apr 23, 2021
andrewvc added a commit to andrewvc/beats that referenced this issue Apr 23, 2021
Adds support for remote zips to browser monitors, letting users just automatically pull from a remote repo.

Fixes elastic/uptime#271
andrewvc added a commit to andrewvc/beats that referenced this issue Apr 23, 2021
Adds support for remote zips to browser monitors, letting users just automatically pull from a remote repo.

Fixes elastic/uptime#271
andrewvc added a commit to elastic/beats that referenced this issue Apr 23, 2021
Adds support for remote zips to browser monitors, letting users just automatically pull from a remote repo.

Fixes elastic/uptime#271
andrewvc added a commit to elastic/beats that referenced this issue Apr 23, 2021
* [Heartbeat] Zip URL Support (#24714)

Adds support for remote zips to browser monitors, letting users just automatically pull from a remote repo.

Fixes elastic/uptime#271

* Fix null check

* Add missing test
@paulb-elastic
Copy link

paulb-elastic commented Apr 26, 2021

For reference, an example configuration in a heartbeat.docker.yml for a remote ZIP location downloading from GitHub, could be:

- type: browser
  name: synth-zip-location
  id: synth-zip-location
  schedule: '@every 120s'
  source:
    zip_url:
        url: "https://github.com/elastic/synthetics/archive/refs/heads/master.zip"
        folder: "examples/todos"
        target_directory: "/tmp/synthetics/suite"
        username: myuser
        password: mypassword

@justinkambic
Copy link

Was able to test this feature using the supplied example zip.

image

@justinkambic justinkambic added the test-plan-ok Indicates an issue has been tested for release label May 4, 2021
@justinkambic justinkambic assigned justinkambic and unassigned andrewvc May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request test-plan-ok Indicates an issue has been tested for release v7.13.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants