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

fix: improvements on follow-up #36

Merged

Conversation

gentlementlegen
Copy link
Member

@gentlementlegen gentlementlegen commented Oct 21, 2024

Resolves #23
QA: Meniole#2

Copy link
Contributor

github-actions bot commented Oct 21, 2024

Unused files (1)

src/helpers/task-deadline.ts

Unused dependencies (1)

Filename dependencies
package.json typebox-validators

gentlementlegen and others added 25 commits October 21, 2024 14:58
Updated test cases to use the run function instead of runPlugin.
Updated default log level to use LOG_LEVEL.INFO constant instead of a string.
Deleted the generated CommonJS distribution file.
Deleted the generated CommonJS distribution file.
Removed the yarn.lock file to reset dependencies.
Removed the outdated express_plugin mock file from tests.
Removed the outdated express_plugin mock file from tests.
Upgraded @octokit/rest and @types/node, and removed unused dependencies.
Added a new input field 'signature' to capture kernel payload signature.
Included kernel public key in environment variables and workflows.
Included kernel public key in environment variables and workflows.
This change eliminates the Node.js setup step from the compute.yml GitHub Actions workflow.
Deleted payload parsing and validation logic along with associated dependencies.
Updated logic to unassign users and send reminders, corrected activity date handling.
gentlementlegen and others added 5 commits October 22, 2024 18:45
Added logic to collect and analyze linked pull request reminders and optimized log management.
Removed redundant deadline management in task-update and fixed function name in watch-user-activity.
Refactored task update logic for better readability and efficiency.
Introduce pullRequestRequired flag in configuration and improve comment retrieval logic.
@gentlementlegen gentlementlegen marked this pull request as ready for review October 22, 2024 10:44
gentlementlegen and others added 8 commits October 22, 2024 21:07
Deleted task-deadline.ts and updated package.json dependencies.
Added ESM support in jest, adjusted test scripts and new config options.
Added actorId to createEvent function, adjusted log levels.
Replaces error throw with logger error and graceful return.
Replaces error throw with logger error and graceful return.
Replaces error throw with logger error and graceful return.
Co-authored-by: アレクサンダー.eth <[email protected]>

return true;
return { message: "OK" };
Copy link
Member

Choose a reason for hiding this comment

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

How about a statusCode: 200 instead

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, will change it. Thought it was not useful because the network call already sends a 200, this is the body.

await remindAssigneesForIssue(context, issue);
const activityEvent = (await getAssigneesActivityForIssue(context, issue, handledMetadata.taskAssignees))
.filter((o) => eventWhitelist.includes(o.event as TimelineEvent))
.shift();
Copy link
Member

@0x4007 0x4007 Oct 23, 2024

Choose a reason for hiding this comment

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

This looks like this can shift an undefined value, I don't think this is type safe. Perhaps you should check if its undefined and throw a specific error for that if you must typecast TimelineEvent.

Copy link
Member Author

@gentlementlegen gentlementlegen Oct 23, 2024

Choose a reason for hiding this comment

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

undefined is checked, the shift is on purpose, to check if there was any activity, and if not define the last activity as when the user got assigned. The one that cannot be undefined is assignedEvent because if it is it means the user never got assigned, and yes in this case I exit the issue check.

.shift();

const assignedDate = DateTime.fromISO(assignedEvent.created_at);
const activityDate = activityEvent?.created_at ? DateTime.fromISO(activityEvent.created_at) : undefined;
Copy link
Member

Choose a reason for hiding this comment

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

I think it should never be undefined. You should throw for that.

Copy link
Member Author

Choose a reason for hiding this comment

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

activityDate can be undefined if the user just assigned itself and never did anything afterwards (which is a common scenario in our repos). When this happens the last activity points to when the user was assigned (coincides with the user sending a /start command).

Enhanced test mocks to better handle event creation and comments.
Enhanced test mocks to better handle event creation and comments.
Enhanced test mocks to better handle event creation and comments.
@gentlementlegen
Copy link
Member Author

@whilefoo @Keyrxng if you want to have a look, I can't assign you as reviewers.

@Keyrxng
Copy link
Contributor

Keyrxng commented Oct 24, 2024

@whilefoo @Keyrxng if you want to have a look, I can't assign you as reviewers.

Just about to clock off bud but I'm happy to after I wake.

@gentlementlegen gentlementlegen merged commit 398f17e into ubiquity-os-marketplace:development Oct 24, 2024
2 checks passed
@ubiquity-os-beta ubiquity-os-beta bot mentioned this pull request Oct 24, 2024
@gentlementlegen
Copy link
Member Author

I re-enabled the workflow as well.

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.

Follow up enhancements
3 participants