Skip to content

Implement grantee report submission system#430

Closed
BoltTouring wants to merge 552 commits into
masterfrom
feature/grantee-reports
Closed

Implement grantee report submission system#430
BoltTouring wants to merge 552 commits into
masterfrom
feature/grantee-reports

Conversation

@BoltTouring
Copy link
Copy Markdown
Contributor

Grantee Report Submission System

Overview

This pull request implements a complete report submission system for OpenSats grantees. The system allows grantees to validate their grant numbers, submit progress reports, and receive confirmation emails with a copy of their submitted reports.

Key Features

1. Grantee Report Submission Flow

  • Two-Step Process: Grant validation followed by report submission
  • Grant Validation: Verifies grant IDs (6-7 digit numbers) against GitHub issues
  • Report Form: Collects project updates, plans for next quarter, and use of funds
  • Report Preview: Allows grantees to preview their report before submission

2. Email Notifications

  • Confirmation Emails: Sends a confirmation email to grantees when they submit a report
  • Report Copy: Includes a full copy of the submitted report in the email
  • SendGrid Integration: Uses SendGrid API for reliable email delivery
  • OpenSats Branding: Emails match OpenSats branding with orange header

3. GitHub Integration

  • Issue Comments: Submits reports as comments on the corresponding grant issue
  • Markdown Formatting: Formats reports in Markdown for readability
  • Grant Verification: Uses GitHub API to verify grant numbers

4. Development and Testing Support

  • Test Mode: Automatically enables test mode in non-production environments
  • Test Grant IDs: Supports test grant IDs (123456, 234567) in development
  • Email Testing: Includes a test script for verifying email functionality

dergigi and others added 30 commits January 16, 2024 23:25
Remove "Project Listing" Wording
* Add 1st draft

* Add link to https://ln.rene-pickhardt.de/

* Reword & add links to BitMEX

* Remove renepay

* Link to StackOverflow question

* Fix publication date

* Add cover image
Very minor changes, feel free to merge after review @lucasmogu
* 1st draft of 0xB10C blog post

* fix: grantee feedback

* fix: feedback from grantee

* fix: authors

* feat: add cover image

* feat(post): use nym instead of twitter handle

* fix: date

* fix: authors
Co-authored-by: Lucas <81401034+lucasmogu@users.noreply.github.com>
Also made a small change to the volunteer bios. Clicking on "Volunteer"
now brings you to
[/about#volunteers](https://opensats.org/about#volunteers).
Change bio from Chief Fiat Officer to Volunteer
* Addison -> Ace

* Rename files
* Update j9.mdx to replace broken URL for CBDC Tracker

J9's bio on the opensats.org site has a hyperlink associated with the "CBDC Tracker Fellowship" words. This hyperlink is broken (https://cbdchumanrights.org/). It needs to be replaced with the following (https://cbdctracker.hrf.org/home) in order to direct viewers to the CBDC Tracker page hosted by HRF.

* Update j9.mdx

Original broken link was:
https://cbdchumanrights.org/

Initially proposed changing to:
https://cbdctracker.hrf.org/home

But better to point to the fellowship link here:
https://cbdctracker.hrf.org/fellows
* Initial import

* Fix markdown violations

* Insert ToC and donate button

* Insert "Donate to Ops" button

* Formatting and line-breaks

* More formatting

* Fix title and date

* Fix author and project order

* Use relative links

* Link to dni profile

* Add cover image

* space -> ecosystem
Merging as requested
@dergigi
Copy link
Copy Markdown
Member

dergigi commented Mar 27, 2025

I npm install'ed the missing modules, but I'm still running into errors. (As does Vercel.)

npm run build will produce the following:

Failed to compile.

./pages/api/report-bot.ts
Module not found: Can't resolve '@/lib/session'

https://nextjs.org/docs/messages/module-not-found

./pages/api/submit-report.ts
Module not found: Can't resolve '@/lib/session'

https://nextjs.org/docs/messages/module-not-found

./pages/api/validate-grant.ts
Module not found: Can't resolve '@/lib/session'

https://nextjs.org/docs/messages/module-not-found

@BoltTouring It seems like the code expect a withSessionRoute function in lib/session, but there is no session file (or /lib folder, for that matter). It seems like your code assumes iron-session to be installed and a lib/withSession.tsx file as explained in this tutorial, but there is none.

Did you git commit all your stuff?

Copy link
Copy Markdown
Member

@dergigi dergigi left a comment

Choose a reason for hiding this comment

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

Looks good! Now we have to "just" fix the build errors.

Try running npm run build on your local machine, I'm pretty sure you'll run into the same build errors as Vercel (because I did too).

Comment thread .env.local.example
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We already have .env.example - why create a new one?

The new fields should be added to the existing .env.example file imho.

Comment thread .eslintignore
@@ -1 +1,2 @@
node_modules
scripts/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why remove the scripts/ folder from the linter?

Comment thread pages/api/report-bot.ts
@@ -0,0 +1,160 @@
import type { NextApiRequest, NextApiResponse } from 'next'
import { Octokit } from '@octokit/rest'
import { withSessionRoute } from '@/lib/session'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this line is the last remaining build error, see my comment in the PR. (3x, because it's in 3 files.)

@BoltTouring
Copy link
Copy Markdown
Contributor Author

fml - vibe debugging is breaking everything. I should have updated my master branch before continuing as there were other changes that caused conflicts that then derailed this PR. I'm going to close this and open a new PR that only contains my changes.

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.

10 participants