[Please Review] Hour Request Approval Feature#2
Open
Jupiterian wants to merge 5 commits into
Open
Conversation
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds an optional automated hour approval workflow that polls the Hour Verification Google Sheet, DMs approvers with approval controls, and writes results back to Sheets. It also wires the feature into Discord interaction handling and documents the setup.
Changes:
- Adds Hour Verification polling, approver resolution, DM buttons/modals, and sheet update helpers.
- Registers hour approval startup and interaction/modal handlers.
- Adds configuration/docs plus tester/debug scripts for the new workflow.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
utils/sheets.js |
Adds Hour Verification grid parsing, confirmer column resolution, status writes, and approver lookup helpers. |
utils/hourApprovalSync.js |
Implements polling, DM notifications, button handling, modal handling, and notified-row persistence. |
events/ready.js |
Starts hour approval polling when enabled. |
events/interactionCreate.js |
Routes hour approval button interactions before existing button handlers. |
events/modalSubmit.js |
Routes hour approval modal submissions before existing modal handling. |
index.js |
Initializes the in-memory hour approval session map. |
README.md |
Documents the optional hour approval feature and related sheet/config setup. |
CLAUDE.md |
Adds developer context for the hour approval sync workflow. |
.env.example |
Adds hour approval configuration variables. |
package.json |
Adds a tester startup script. |
scripts/print-row-3109.js |
Adds an ad-hoc script for inspecting a specific Hour Verification row. |
scripts/debug-pending.js |
Adds an ad-hoc script for inspecting pending hour approval rows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1", | ||
| "start": "node index.js", | ||
| "start-tester": "ENV_FILE=.env.tester node index.js", |
| ### Data Writing | ||
| - **User verification** - Logs new member verification data | ||
| - **Left users tracking** - Marks users who left the server (red background) | ||
| - **Hour verification** - Updates verdict (column C) and approver name (column F) when leadership approves via DM |
Comment on lines
+245
to
+246
| if (notifiedRows.has(request.rowNumber)) { | ||
| continue; |
Comment on lines
+522
to
+528
| for (const [headerName, columnIndex] of confirmerColumnMap.entries()) { | ||
| if (normalized.includes(headerName) || headerName.includes(normalized)) { | ||
| return columnIndex; | ||
| } | ||
| } | ||
|
|
||
| return this.findConfirmerColumnByFuzzyHeader(normalized, confirmerColumnMap); |
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.
Please review and test this feature one more time before PR.
Any changes have been reflected in an updated README.md and CLAUDE.md