Develop - #86
Merged
Merged
Conversation
…g pgfunctions.js for now
There was a problem hiding this comment.
Pull request overview
This pull request updates the deployment workflow and backend initialization/endpoint behavior to improve deployment correctness and reduce unnecessary exposure of API metadata.
Changes:
- Updates
.github/workflows/deploy.ymlto verify App Runner operation status and confirm the deployed image matches the expected ECR image before running health checks. - Removes deprecated
promiseLibconfiguration forpg-promiseinitialization (aligning with pg-promise v12 behavior) in bothsrc/neotomaapi.jsanddatabase/pgp_db.js. - Tightens
/api/default behavior to avoid listing available Postgres-backed functions unless an explicitmethodis provided.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/deploy.yml |
Adds App Runner deployment verification and refines health-check flow/messages. |
src/neotomaapi.js |
Removes bluebird/promiseLib usage for pg-promise initialization. |
database/pgp_db.js |
Removes deprecated promiseLib option and documents pg-promise v12 behavior. |
pgfunctions/pgfunction.js |
Stops advertising available Postgres functions on the bare /api/ endpoint unless method is provided. |
Suppressed comments (1)
pgfunctions/pgfunction.js:61
- The large commented-out “Previous behaviour” block after the early
returnis dead code and will never run, but it still adds noise and makes this handler harder to read/maintain. Git history already preserves the old implementation.
/* ---- Previous behaviour, retained for reference ----
// We're passing in the raw "/api/" endoint, which requests the set of all functions.
db.any(queryFunc)
.then(data => {
return res.status(200)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -44,6 +44,17 @@ function allFunctions (req, res, next) { | |||
| // enters no parameters, or the term 'method' fails to appear in the | |||
| // user query string. | |||
| if (noParam | !outobj.method) { | |||
|
|
||
| if [ "$OP_STATUS" != "SUCCEEDED" ]; then | ||
| echo "::error::App Runner deployment did not succeed (status: $OP_STATUS)." | ||
| echo "The service has rolled back and is still running the previous image." |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request updates the deployment workflow and backend code to improve deployment reliability, security, and maintainability. The main changes include adding robust verification steps for App Runner deployments, updating environment variables, removing deprecated code, and tightening API endpoint behavior.
Deployment workflow improvements:
.github/workflows/deploy.ymlto ensure that App Runner deployments are actually running the intended image, not just reporting CloudFormation success. The workflow now checks the App Runner operation status and validates the running image before running health checks. [1] [2]ENDPOINTenvironment variable for the development environment totiliatank.neotomadb.orgfor correct labeling.Backend code maintenance:
promiseLiboption and related imports frompg-promiseinitialization in bothdatabase/pgp_db.jsandsrc/neotomaapi.js, as it is no longer supported inpg-promisev12 and now uses native promises. [1] [2]API endpoint tightening:
/api/endpoint behavior inpgfunctions/pgfunction.jsto no longer list all available Postgres functions unless amethodparameter is explicitly provided, improving security by not exposing the function list. [1] [2]