-
Notifications
You must be signed in to change notification settings - Fork 0
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
Sentry implementation #9
base: main
Are you sure you want to change the base?
Conversation
Updated dependencies Moved to aws js sdk v3 New eslint config Added prettier Got rid of node-fetch Added Sentry dependencies
- pins node version to .nvmrc - pins 3rd party actions - updates checkout and setup-node actions - installs tsc?? - does sentry sourcemaps
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.
👍 Looks good to me! Reviewed everything up to 5443210 in 51 seconds
More details
- Looked at
1525
lines of code in13
files - Skipped
3
files when reviewing. - Skipped posting
8
drafted comments based on config settings.
1. .github/workflows/ecr.yml:14
- Draft comment:
Ensure thatactions/setup-node@v4
is compatible with your project requirements and any other tools you are using. This update should be tested to confirm it doesn't introduce any issues. - Reason this comment was not posted:
Confidence changes required:50%
The change fromactions/checkout@v3
toactions/checkout@v4
is correct as it updates to the latest version. However, theactions/setup-node@v4
should be checked for compatibility with the rest of the workflow.
2. .github/workflows/ecr.yml:29
- Draft comment:
Good use ofnpm ci
for clean installation of dependencies in CI environments. - Reason this comment was not posted:
Confidence changes required:0%
Thenpm ci
command is used correctly here for installing dependencies in a clean state, which is suitable for CI environments.
3. .github/workflows/node.js.yml:22
- Draft comment:
Good use ofnpm ci
for clean installation of dependencies in CI environments. - Reason this comment was not posted:
Confidence changes required:0%
Thenpm ci
command is used correctly here for installing dependencies in a clean state, which is suitable for CI environments.
4. .github/workflows/node.js.yml:21
- Draft comment:
Usingnode-version-file
to specify Node.js version from.nvmrc
ensures consistency across environments. - Reason this comment was not posted:
Confidence changes required:0%
Thenode-version-file
is correctly used to specify the Node.js version from.nvmrc
. This ensures consistency across environments.
5. .github/workflows/ecr.yml:27
- Draft comment:
Usingnode-version-file
to specify Node.js version from.nvmrc
ensures consistency across environments. - Reason this comment was not posted:
Confidence changes required:0%
Thenode-version-file
is correctly used to specify the Node.js version from.nvmrc
. This ensures consistency across environments.
6. .github/workflows/ecr.yml:45
- Draft comment:
Ensure that globally installingtsc
is necessary and doesn't conflict with any local TypeScript versions specified in your project. - Reason this comment was not posted:
Confidence changes required:30%
Thenpm install tsc -g
command is used to globally install TypeScript compiler, which is necessary for the build process.
7. .github/workflows/node.js.yml:23
- Draft comment:
Ensure that globally installingtsc
is necessary and doesn't conflict with any local TypeScript versions specified in your project. - Reason this comment was not posted:
Confidence changes required:30%
Thenpm install tsc -g
command is used to globally install TypeScript compiler, which is necessary for the build process.
8. Dockerfile:6
- Draft comment:
Good use ofnpm ci
for clean and consistent installation of dependencies in Dockerfile. - Reason this comment was not posted:
Confidence changes required:0%
TheDockerfile
usesnpm ci
which is appropriate for CI/CD environments to ensure a clean and consistent install of dependencies.
Workflow ID: wflow_reFTQpIZRIZkzdJr
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
…ring Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ring Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ring Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.
👍 Looks good to me! Incremental review on 4ab9ee5 in 16 seconds
More details
- Looked at
67
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. src/ThumbnailApi.ts:84
- Draft comment:
Logging the entire error object may not be necessary. Consider logging just the error message for better readability.
console.error("Sending %s for %s: %s", code, itemId, error?.message);
- Reason this comment was not posted:
Confidence changes required:50%
The error logging insendError
should include the error message, not the entire error object, for better readability.
2. src/ThumbnailApi.ts:334
- Draft comment:
Consider moving theaddHeader
function outside ofgetHeadersFromTarget
for better readability and performance.
function addHeader(result: Map<string, string>, headers: Headers, header: string) {
if (headers.has(header)) {
result.set(header, headers.get(header));
}
}
- Reason this comment was not posted:
Confidence changes required:50%
ThegetHeadersFromTarget
function uses a helper functionaddHeader
which is defined inside it. This is unnecessary and can be moved outside for better readability and performance.
Workflow ID: wflow_HshUkEi9z7IKVPpP
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
❌ Changes requested. Incremental review on d82313d in 56 seconds
More details
- Looked at
197
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. test/unit.ts:104
- Draft comment:
ThegetCacheHeaders
function is expected to return aMap
, but the test is treating it as if it returns an object. This could lead to confusion or errors if the implementation changes.
t.is(result.get("Cache-Control"), "public, max-age=2");
- Reason this comment was not posted:
Comment looked like it was already resolved.
2. test/unit.ts:151
- Draft comment:
ThegetHeadersFromTarget
function is expected to return aMap
, but the test is treating it as if it returns an object. This could lead to confusion or errors if the implementation changes.
t.is(responseHeaders.get("Last-Modified"), headers.get("Last-Modified"));
- Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_6jL8MOP7rDF13GSy
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
test/unit.ts
Outdated
"/thumb/1234": undefined, | ||
}; | ||
|
||
Object.entries(testData).forEach((entry: [string, never]): void => { |
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.
The type annotation for the entry
parameter in the forEach
method is incorrect. The second element of the tuple should be string | undefined
instead of never
. This is because the testData
object contains both strings and undefined
as values.
Object.entries(testData).forEach((entry: [string, never]): void => { | |
Object.entries(testData).forEach((entry: [string, string | undefined]): void => { |
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.
👍 Looks good to me! Incremental review on 47dab4e in 26 seconds
More details
- Looked at
21
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. test/unit.ts:23
- Draft comment:
The type annotation forresult
should bestring | undefined
to match the possible return values ofthumb.getItemId
. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_JM78qBz9SE2HrCJs
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on 707908f in 55 seconds
More details
- Looked at
229
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. src/ThumbnailApi.ts:260
- Draft comment:
UsingPromise.reject
for error handling is not ideal. Consider throwing an error instead for better stack trace and error propagation.
throw new Error("Couldn't find image URL in record.");
- Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The method is async and returns Promise. Both Promise.reject and throw would work here. Promise.reject is used consistently in other error cases in this file (lines 111, 116, 126, 266, 270). Changing just one instance would make the code less consistent. The stack trace argument is not compelling since async/await provides good stack traces either way.
The comment makes a valid point that throw is generally preferred in async functions. The current error handling could be improved by using Error objects consistently.
While throw might be marginally better, changing just one instance would reduce consistency. Any error handling improvements should be done systematically across the file.
Delete the comment. While the suggestion has merit, it would reduce code consistency to change just this one instance, and the current approach works fine.
2. src/ThumbnailApi.ts:252
- Draft comment:
UsingPromise.reject
for error handling is not ideal. Consider throwing an error instead for better stack trace and error propagation. This applies to all instances in this method. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_9wVu411kThyO8Ttv
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Integrates Sentry for error tracking, updates AWS SDK usage, refactors
ThumbnailApi
, and updates CI workflows and dependencies.src/instrumentation.js
.src/app.ts
and sets up error handling.aws-sdk
with@aws-sdk/client-s3
and@aws-sdk/client-sqs
insrc/ThumbnailApi.ts
.src/app.ts
andtest/integration.ts
.ThumbnailApi
class insrc/ThumbnailApi.ts
for improved error handling and async operations.getS3Url
,lookupImageInS3
, andqueueToThumbnailCache
methods.actions/checkout@v4
andactions/setup-node@v4
.ecr.yml
.package.json
with new dependencies and scripts for Sentry and Prettier..prettierrc.json
andeslint.config.mjs
for code formatting and linting.lts/Jod
in.nvmrc
andDockerfile
.This description was created by for 707908f. It will automatically update as commits are pushed.