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

doc: add instructions to create new reference project and run it locally #1417

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

tarunps
Copy link
Contributor

@tarunps tarunps commented Oct 17, 2024

Closes #1362

✅ Checklist

  • I have followed every step in the contributing guide
  • The PR title follows the convention.
  • I ran and tested the code works

Testing

[Describe the steps you took to test this change]


Changelog

[Short description of what has changed]

  • Added instructions to create on how to create a new reference project and running it against a local instance.

Screenshots

[Screenshots]

💯

Summary by CodeRabbit

Summary by CodeRabbit

  • Documentation
    • Introduced a new section in the README for "Creating a New Reference Project" with detailed setup instructions.
    • Provided step-by-step guidance for using ngrok, updating environment files, running the web application, and deploying new projects.

/claim #1362

Copy link

changeset-bot bot commented Oct 17, 2024

⚠️ No Changeset found

Latest commit: f9494f2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@tarunps tarunps marked this pull request as ready for review October 18, 2024 09:43
Copy link
Contributor

coderabbitai bot commented Oct 18, 2024

Walkthrough

The changes in the references/README.md file introduce a new section titled "Creating a New Reference Project." This section provides detailed, step-by-step instructions for setting up a new reference project within the trigger.dev framework. It includes prerequisites for local setup and outlines specific commands and configurations necessary for running and deploying a new project.

Changes

File Change Summary
references/README.md Added a section with detailed instructions for creating and managing a new reference project, including setup steps and CLI commands.

Assessment against linked issues

Objective Addressed Explanation
Create a new reference project by copying the hello-world reference project (#[1362])
Get the dev CLI command running against a local instance of Trigger.dev (#[1362])
Ensure the README is sufficient for a new contributor to create and deploy a new reference project (#[1362])

Possibly related PRs

🐇 In the meadow, where bunnies play,
New projects bloom in a joyful way.
With ngrok's tunnel and CLI's might,
We hop along, our future bright!
So gather 'round, let’s code and cheer,
For every project brings us near! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between dd2a2ac and f9494f2.

📒 Files selected for processing (1)
  • references/README.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • references/README.md

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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 testing code 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (5)
references/README.md (5)

55-67: Minor improvements for clarity and consistency.

The instructions for setting up and running ngrok are clear and detailed. However, there are a couple of minor issues to address:

  1. Grammar: Use "an" instead of "a" before "http tunnel" in lines 55 and 56.
  2. Code blocks: Add language specifications to the code blocks for better syntax highlighting.

Here's a suggested fix for the grammar:

-1. **Run a http tunnel**:
-You will need to run a http tunnel to expose your local webapp, it is required for some API calls during building the image to deploy on your local instance.
+1. **Run an HTTP tunnel**:
+You will need to run an HTTP tunnel to expose your local webapp, it is required for some API calls during building the image to deploy on your local instance.

For the code blocks, add the language specification like this:

-```
+```bash
 ngrok config add-authtoken <your-auth-token>

- +bash
ngrok http

🧰 Tools
🪛 LanguageTool

[misspelling] ~55-~55: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...### Step-by-Step Instructions 1. Run a http tunnel: You will need to run a h...

(EN_A_VS_AN)


[misspelling] ~56-~56: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...n a http tunnel**: You will need to run a http tunnel to expose your local webapp...

(EN_A_VS_AN)

🪛 Markdownlint

59-59: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


64-64: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


73-77: Add language specification to code block.

The command for running the webapp locally is correct and includes all necessary components. To improve readability and enable syntax highlighting, consider adding a language specification to the code block.

Here's the suggested change:

-```
+```bash
 pnpm run dev --filter webapp --filter coordinator --filter docker-provider

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Markdownlint</summary><blockquote>

75-75: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</blockquote></details>

</details>

---

`79-87`: **Add language specifications to code blocks.**

The instructions for building the CLI and making it accessible are clear and comprehensive. To improve readability and enable syntax highlighting, consider adding language specifications to the code blocks.


Here's the suggested change:

```diff
-```
+```bash
 # Build the CLI
 pnpm run build --filter trigger.dev

 # Make it accessible to `pnpm exec`
 pnpm i

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Markdownlint</summary><blockquote>

81-81: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</blockquote></details>

</details>

---

`94-100`: **Add language specification to code block.**

The instructions for copying the hello-world project as a template are clear and include a placeholder for the new project name. To improve readability and enable syntax highlighting, consider adding a language specification to the code block.


Here's the suggested change:

```diff
-```
+```bash
 cp -r references/hello-world references/<new-project>

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Markdownlint</summary><blockquote>

96-96: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</blockquote></details>

</details>

---

`110-127`: **LGTM: Clear instructions for CLI authorization and project execution. Minor formatting suggestion.**

The instructions for authorizing the CLI, running, and deploying the project are clear and comprehensive. These steps align well with the PR objectives of running and deploying a reference project locally.

To improve readability and enable syntax highlighting, consider adding language specifications to the code blocks.



Here are the suggested changes:

```diff
-```
+```bash
 pnpm exec trigger login -a http://localhost:3030 --profile local

- +bash
pnpm exec trigger dev --profile local


-```
+```bash
pnpm exec trigger deploy --self-hosted --load-image --profile local

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Markdownlint</summary><blockquote>

112-112: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

119-119: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

125-125: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</blockquote></details>

</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**

<details>
<summary>📥 Commits</summary>

Files that changed from the base of the PR and between ef7f11222709f30c9f3da7c3c1d41bf099cd8d9e and dd2a2ac6a56e7d13b76fe0f45441f5827b5a0c15.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* references/README.md (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>



<details>
<summary>🪛 LanguageTool</summary><blockquote>

<details>
<summary>references/README.md</summary><blockquote>

[misspelling] ~55-~55: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...### Step-by-Step Instructions  1. **Run a http tunnel**: You will need to run a h...

(EN_A_VS_AN)

---

[misspelling] ~56-~56: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...n a http tunnel**: You will need to run a http tunnel to expose your local webapp...

(EN_A_VS_AN)

</blockquote></details>

</blockquote></details>
<details>
<summary>🪛 Markdownlint</summary><blockquote>

<details>
<summary>references/README.md</summary><blockquote>

59-59: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

64-64: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

75-75: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

81-81: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

96-96: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

112-112: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

119-119: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

125-125: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</blockquote></details>

</blockquote></details>

</details>

<details>
<summary>🔇 Additional comments (5)</summary><blockquote>

<details>
<summary>references/README.md (5)</summary><blockquote>

`49-51`: **LGTM: Clear introduction and prerequisite reference.**

The introduction clearly states the purpose of the new section and appropriately references the Contributing.md file for initial setup. This aligns well with the PR objective and helps ensure users have the necessary local environment set up before proceeding.

---

`69-71`: **LGTM: Clear instructions for environment setup.**

The instructions for updating the APP_ORIGIN variable in the .env file are clear and concise. This step is crucial for the local setup and aligns well with the PR objectives.

---

`89-93`: **LGTM: Clear instructions for project setup in webapp.**

The instructions for setting up a new project in the webapp are clear, concise, and align well with the PR objectives. This step is crucial for creating a new reference project.

---

`102-108`: **LGTM: Comprehensive instructions for project configuration.**

The instructions for updating project details are clear, comprehensive, and cover all necessary updates (package.json, trigger.config.ts, and syncing dependencies). This step aligns well with the PR objectives of creating a new reference project.

---

`49-127`: **Excellent addition of comprehensive instructions for creating a new reference project.**

The new section "Creating a New Reference Project" successfully addresses the documentation gap outlined in issue #1362. The instructions are clear, detailed, and cover all aspects of creating, running, and deploying a new reference project locally. This includes:

1. Setting up the local environment with ngrok
2. Configuring the project in the webapp
3. Copying and customizing the template project
4. Building and authorizing the CLI
5. Running and deploying the project locally

The step-by-step guide aligns perfectly with the PR objectives and provides valuable assistance to new contributors. The minor suggestions for grammar and code block formatting will further enhance the readability of the document.

Great job on improving the documentation!

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 LanguageTool</summary><blockquote>

[misspelling] ~55-~55: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...### Step-by-Step Instructions  1. **Run a http tunnel**: You will need to run a h...

(EN_A_VS_AN)

---

[misspelling] ~56-~56: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...n a http tunnel**: You will need to run a http tunnel to expose your local webapp...

(EN_A_VS_AN)

</blockquote></details>
<details>
<summary>🪛 Markdownlint</summary><blockquote>

59-59: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

64-64: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

75-75: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

81-81: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

96-96: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

112-112: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

119-119: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

125-125: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</blockquote></details>

</details>

</blockquote></details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@ericallam ericallam merged commit 235ab90 into triggerdotdev:main Oct 18, 2024
1 check passed
nicktrn pushed a commit that referenced this pull request Oct 22, 2024
…lly (#1417)

* doc: add instructions to create new reference project and run it locally

* doc: Add instruction for running tunnel

* minor language improvement
nicktrn added a commit that referenced this pull request Oct 24, 2024
* refactor finalize run service

* refactor complete attempt service

* remove separate graceful exit handling

* refactor task status helpers

* clearly separate statuses in prisma schema

* all non-final statuses should be failable

* new import payload error code

* store default retry config if none set on task

* failed run service now respects retries

* fix merged task retry config indexing

* some errors should never be retried

* finalize run service takes care of acks now

* execution payload helper now with single object arg

* internal error code enum export

* unify failed and crashed run retries

* Prevent uncaught socket ack exceptions (#1415)

* catch all the remaining socket acks that could possibly throw

* wrap the remaining handlers in try catch

* New onboarding question (#1404)

* Updated “Twitter” to be “X (Twitter)”

* added Textarea to storybook

* Updated textarea styling to match input field

* WIP adding new text field to org creation page

* Added description to field

* Submit feedback to Plain when an org signs up

* Formatting improvement

* type improvement

* removed userId

* Moved submitting to Plain into its own file

* Change orgName with name

* use sendToPlain function for the help & feedback email form

* use name not orgName

* import cleanup

* Downgrading plan form uses sendToPlain

* Get the userId from requireUser only

* Added whitespace-pre-wrap to the message property on the run page

* use requireUserId

* Removed old Plain submit code

* Added a new Context page for the docs (#1416)

* Added a new context page with task context properties

* Removed code comments

* Added more crosslinks

* Fix updating many environment variables at once (#1413)

* Move code example to the side menu

* New docs example for creating a HN email summary

* doc: add instructions to create new reference project and run it locally (#1417)

* doc: add instructions to create new reference project and run it locally

* doc: Add instruction for running tunnel

* minor language improvement

* Fix several restore and resume bugs (#1418)

* try to correct resume messages with missing checkpoint

* prevent creating checkpoints for outdated task waits

* prevent creating checkpoints for outdated batch waits

* use heartbeats to check for and clean up any leftover containers

* lint

* improve exec logging

* improve resume attempt logs

* fix for resuming parents of canceled child runs

* separate SIGTERM from maybe OOM errors

* pretty errors can have magic dashboard links

* prevent uncancellable checkpoints

* simplify task run error code enum export

* grab the last, not the first child run

* Revert "prevent creating checkpoints for outdated batch waits"

This reverts commit f2b5c2a.

* Revert "grab the last, not the first child run"

This reverts commit 89ec5c8.

* Revert "prevent creating checkpoints for outdated task waits"

This reverts commit 11066b4.

* more logs for resume message handling

* add magic error link comment

* add changeset

* chore: Update version for release (#1410)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Release 3.0.13

* capture ffmpeg oom errors

* respect maxAttempts=1 when failing before first attempt creation

* request worker exit on fatal errors

* fix error code merge

* add new error code to should retry

* pretty segfault errors

* pretty internal errors for attempt spans

* decrease oom false positives

* fix timeline event color for failed runs

* auto-retry packet import and export

* add sdk version check and complete event while completing attempt

* all internal errors become crashes by default

* use pretty error helpers exclusively

* error to debug log

* zodfetch fixes

* rename import payload to task input error

* fix true non-zero exit error display

* fix retry config parsing

* correctly mark crashes as crashed

* add changeset

* remove non-zero exit comment

* pretend we don't support default default retry configs yet

---------

Co-authored-by: James Ritchie <[email protected]>
Co-authored-by: shubham yadav <[email protected]>
Co-authored-by: Tarun Pratap Singh <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@coderabbitai coderabbitai bot mentioned this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

doc need: creating a new reference project and deploying it locally
2 participants