Skip to content

Handle bucket input and creation if necessary #106

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 1 commit into from
Feb 23, 2024

Conversation

adamfweidman
Copy link
Collaborator

@adamfweidman adamfweidman commented Feb 21, 2024

The changes revolve mainly around getOrCreateStorageBucket() which attempts to find an existing GCS bucket if provided by the user. If no bucket is provided we check to see if a dedicated syntetics bucket already exists if not then we will use create it.

Note that at any point in time any failure will not cause the execution to fail, rather it will be added to an "errors" array that is returned in the api response. (this is the errors: BaseError array in BrokenLinksResultV1).

A note on testing:

  • sinon is a library that is used to mock objects or classes that are passed into a function. I've tried to use this as much as possible as it is the simplest to use and the most straightforward.
  • However, in the case of resolveProjectId() and getExecutionRegion() I have to mock an import that I do not have access to when calling the function. I have use proxyquire for this, after exploring many different options this is the only one that seemed to work.
  • Why is it ok to take on this new dependency? This is a devDependency meaning we are not reliant on it in production! Additionally, the storage-sdk also uses it.

@adamfweidman adamfweidman force-pushed the bucket-storage-creation branch 2 times, most recently from 0030f53 to ce5df67 Compare February 21, 2024 18:58
@adamfweidman adamfweidman changed the title resolveProjectId present Handle bucket input and creation if necessary Feb 21, 2024
@adamfweidman adamfweidman force-pushed the bucket-storage-creation branch from ce5df67 to efb7416 Compare February 21, 2024 22:17
@adamfweidman adamfweidman force-pushed the bucket-storage-creation branch from efb7416 to 4f14fd0 Compare February 23, 2024 19:00
@adamfweidman adamfweidman merged commit d6ad3e4 into final-blc-storage Feb 23, 2024
adamfweidman added a commit that referenced this pull request Feb 28, 2024
adamfweidman added a commit that referenced this pull request Feb 28, 2024
adamfweidman added a commit that referenced this pull request Mar 20, 2024
adamfweidman added a commit that referenced this pull request Apr 19, 2024
* get-cloud-region (#100)

Add functionality to synthetics-sdk-api to extract cloud region during GCF execution

* stoage proto api (#101)

* expose resolveProjectId (#104)

* update to capture_condition (#109)

* chore(deps): bump ip from 1.1.8 to 1.1.9 (#105)

* chore(deps): bump ip from 1.1.8 to 1.1.9

Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9.
- [Commits](indutny/node-ip@v1.1.8...v1.1.9)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* Empty-Commit

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adam Weidman <[email protected]>

* add samples tags (#108)

* blc-api-integration-def (#102)

* resolveProjectId present (#106)

* take-screenshots (#107)

* rebase-capture-condition (#110)

* refactor-integrations (#112)

* sanitize strings (#113)

* Take and populate screenshot (#114)

* screenshots-prop

* broken_links.spec working

* fix naming

* pass-args

* response to comments

* change default (#118)

* update synthetics-sdk-api to point to new npm pkg

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
adamfweidman added a commit that referenced this pull request Apr 19, 2024
adamfweidman added a commit that referenced this pull request Apr 19, 2024
* blc-api-integration-def (#102)

* resolveProjectId present (#106)

* take-screenshots (#107)

* rebase-capture-condition (#110)

* refactor-integrations (#112)

* sanitize strings (#113)

* Take and populate screenshot (#114)

* screenshots-prop

* broken_links.spec working

* fix naming

* pass-args

* response to comments

* change default (#118)

* update synthetics-sdk-api to point to new npm pkg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants