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

Import from ethereum events sheet #12463

Merged
merged 10 commits into from
Mar 22, 2024
Merged

Import from ethereum events sheet #12463

merged 10 commits into from
Mar 22, 2024

Conversation

wslyvh
Copy link
Member

@wslyvh wslyvh commented Mar 15, 2024

Adding an importer to fetch community events from the Ethereum Events sheet.
https://docs.google.com/spreadsheets/d/1NEu_FCc1hnGAuRgPmbXXpf0h2lCrCOlMKbbFEqgkVDQ/

Description

It's hard to maintain an up to date overview of community events. This PR adds an importer from a known Google Sheet to help populate the community events page. The idea is that you can add multiple importers, while also keeping your own, internal JSON file where people can suggest to add their own events, so you're not just relying on the sheet for populating the events overview.

TODOs

  • Try to match a write events to events JSON on the repo
  • Add a Github Action periodically run the importer as a cron job

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Enhanced the functionality to import community events data from Ethereum into the application.
    • Introduced a GitHub Actions workflow for importing community events weekly.

Copy link
Contributor

coderabbitai bot commented Mar 15, 2024

Walkthrough

These changes enhance the project's event management by enabling the import of community events from Ethereum. A new script, events-import.ts, orchestrates the import process, utilizing environment variables for configuration. Additionally, a dedicated function, EthereumEventsImport, is implemented in ethereum-events-import.ts to retrieve, process, and transform Ethereum events data from a Google Sheet into CommunityConference objects for integration into Events.json.

Changes

File(s) Change Summary
src/scripts/events-import.ts Introduces a script for initiating Ethereum events import process
src/scripts/events/ethereum-events-import.ts Implements EthereumEventsImport to fetch and process Ethereum events data
src/components/UpcomingEventsList.tsx Updates to import community-events.json and adjust eventsList declaration
src/lib/types.ts Adds imageUrl field to the CommunityConference type
.github/workflows/import-community-events.yml Adds GitHub Actions workflow for weekly import of community events

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@wslyvh wslyvh marked this pull request as draft March 15, 2024 11:01
@github-actions github-actions bot added dependencies 📦 Changes related to project dependencies review needed 👀 tooling 🔧 Changes related to tooling of the project labels Mar 15, 2024
Copy link

netlify bot commented Mar 15, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 2e5f11b
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/65fca3f37d1b9300082e27c8
😎 Deploy Preview https://deploy-preview-12463--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 90e4310 and b646a20.
Files ignored due to path filters (1)
  • package.json is excluded by: !**/*.json
Files selected for processing (2)
  • src/scripts/events-import.ts (1 hunks)
  • src/scripts/events/ethereum-events-import.ts (1 hunks)

src/scripts/events-import.ts Outdated Show resolved Hide resolved
src/scripts/events/ethereum-events-import.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot added the event 📅 This issue or pull request is related to an event listing label Mar 18, 2024
@wslyvh wslyvh marked this pull request as ready for review March 18, 2024 19:14
@wslyvh wslyvh changed the title [WIP] import from ethereum events sheet Import from ethereum events sheet Mar 18, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b646a20 and 57590ef.
Files ignored due to path filters (1)
  • src/data/community-events.json is excluded by: !**/*.json
Files selected for processing (5)
  • .github/workflows/import-community-events.yml (1 hunks)
  • src/components/UpcomingEventsList.tsx (2 hunks)
  • src/lib/types.ts (1 hunks)
  • src/scripts/events-import.ts (1 hunks)
  • src/scripts/events/ethereum-events-import.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/scripts/events/ethereum-events-import.ts
Additional comments: 9
.github/workflows/import-community-events.yml (4)
  • 5-5: The cron schedule is set correctly to run every Sunday at midnight. This is a good practice for periodic tasks that don't require immediate updates.
  • 12-12: Using actions/checkout@master is generally fine, but consider pinning to a specific version or commit hash for more predictable builds.
  • 16-19: The use of environment variables for sensitive information like GOOGLE_API_KEY is a good practice for security.
  • 20-23: Automatically committing changes with EndBug/add-and-commit@v9 is efficient. Ensure that the default_author: github_actions aligns with your project's contribution guidelines.
src/scripts/events-import.ts (1)
  • 10-32: The overall structure of the script is clear and follows good practices for asynchronous operations with an immediately invoked function expression (IIFE).
src/components/UpcomingEventsList.tsx (3)
  • 14-14: Importing community-events.json directly is a straightforward way to use static data in a React component.
  • 40-40: Casting communityEvents as CommunityConference[] is necessary due to the dynamic nature of JSON imports in TypeScript.
  • 11-17: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]

Consider using React's lazy loading for components that are not immediately visible to improve initial load times. This is especially useful for components like event lists that can grow over time.

src/lib/types.ts (1)
  • 493-493: Adding the imageUrl field to the CommunityConference type is consistent with the PR's objective of enhancing event data. Ensure all components using this type are updated accordingly.

src/scripts/events-import.ts Outdated Show resolved Hide resolved
src/scripts/events-import.ts Outdated Show resolved Hide resolved
@wslyvh
Copy link
Member Author

wslyvh commented Mar 19, 2024

Ready for review

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 57590ef and edf3871.
Files ignored due to path filters (1)
  • src/data/community-events.json is excluded by: !**/*.json
Files selected for processing (3)
  • .github/workflows/import-community-events.yml (1 hunks)
  • src/scripts/events-import.ts (1 hunks)
  • src/scripts/events/ethereum-events-import.ts (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/import-community-events.yml
  • src/scripts/events-import.ts
  • src/scripts/events/ethereum-events-import.ts

@nloureiro
Copy link
Contributor

This looks great from my perspective.

I will follow up with another PR with the design change, but we can push this to production from my side.

@pettinarip or @wackerow : I might need some of your eyes here.

Thank you, @wslyvh, for this!!!!

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

LGTM @wslyvh 💪🏼 nice job!

Copy link
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

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

Nice! Thanks @wslyvh, this looks great! Just gonna push one small commit to remove the guard for a hard-coded variable and then pull this in. Thanks again!

(On the side, we need to double-check that our GOOGLE_API_KEY token has the appropriate permissions and update if not.)

src/scripts/events/ethereum-events-import.ts Outdated Show resolved Hide resolved
@wackerow wackerow merged commit dce32b8 into ethereum:dev Mar 22, 2024
9 of 10 checks passed
Copy link

gitpoap-bot bot commented Mar 22, 2024

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

Be sure to join the Ethereum.org discord if you are interested in contributing further to the project or have any questions for the team.

GitPOAP: 2024 Ethereum.org Contributor:

GitPOAP: 2024 Ethereum.org Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

@wackerow
Copy link
Member

@all-contributors please add @wslyvh for infra

Copy link
Contributor

@wackerow

I've put up a pull request to add @wslyvh! 🎉

This was referenced Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies 📦 Changes related to project dependencies event 📅 This issue or pull request is related to an event listing tooling 🔧 Changes related to tooling of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants