Skip to content

Conversation

@glasnt
Copy link
Contributor

@glasnt glasnt commented Feb 25, 2025

Description

Fixes #

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed guidelines from CONTRIBUTING.MD and Samples Style Guide
  • Tests pass: npm test (see Testing)
  • Lint pass: npm run lint (see Style)
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This pull request is from a branch created directly off of GoogleCloudPlatform/nodejs-docs-samples. Not a fork.
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new sample directory, and I created GitHub Actions workflow for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@product-auto-label product-auto-label bot added samples Issues that are directly related to samples. api: cloudfunctions Issues related to the Cloud Run functions API. asset: pattern DEE Asset tagging - Pattern. labels Feb 25, 2025
@glasnt
Copy link
Contributor Author

glasnt commented Feb 28, 2025

This PR is failing with Error: Promise rejected with no or falsy reason

@glasnt glasnt marked this pull request as ready for review March 6, 2025 05:29
@glasnt glasnt requested review from a team as code owners March 6, 2025 05:29
Copy link
Collaborator

@grayside grayside left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a couple notes and one very optional, minor change suggestion.

require('../index');

// ImageMagick is available by default in Cloud Run Functions environments
// https://cloud.google.com/functions/1stgendocs/tutorials/imagemagick-1st-gen.md#importing_dependencies
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-checked that Imagemagick is still included in the system packages for v2+: https://cloud.google.com/functions/docs/reference/system-packages

// ImageMagick is available by default in Cloud Run Functions environments
// https://cloud.google.com/functions/1stgendocs/tutorials/imagemagick-1st-gen.md#importing_dependencies
// Manually install it for testing only.
execSync('sudo apt-get install imagemagick -y');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion(non-blocking): Move this into an additional before hook below and switch to an async exec for a potentially minor performance gain.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

installing this async was causing issues, so I'm making sure the change happens before the before using this method

Comment on lines 91 to 93
"functions/billing", // Error: Request failed with status code 500
"functions/http/uploadFile", // npm error Missing script: "test"
"functions/ocr/app", // Error: Bucket not provided. Make sure you have a "bucket" property in your request
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I do not know if you have criteria on removing the (untested) flag beyond the test fixes in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diff is unrelated to my intended changes; it should just be "move a check from skip in prod to skip in dev". I think there's some changes in main since this branch was checked out causing this

@glasnt glasnt merged commit e169459 into main Mar 7, 2025
13 checks passed
@glasnt glasnt deleted the ariwete-imagemagick branch March 7, 2025 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: cloudfunctions Issues related to the Cloud Run functions API. asset: pattern DEE Asset tagging - Pattern. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants