Skip to content

Fix Cloudflare Pages crash without latest deployment - #29007

Merged
raycastbot merged 2 commits into
raycast:mainfrom
mralonsocorona:fix/cloudflare-pages-null-latest-stage
Jun 25, 2026
Merged

raycastbot merged 2 commits into
raycast:mainfrom
mralonsocorona:fix/cloudflare-pages-null-latest-stage

Conversation

@mralonsocorona

Copy link
Copy Markdown
Contributor

Summary

Fixes a crash in the Cloudflare View Pages command when a Pages project has no latest deployment.

The Cloudflare API can return latest_deployment as null, but the extension previously accessed latest_deployment.latest_stage.status directly.

Changes

  • Allow Pages projects to have a missing latest deployment.
  • Allow deployment stages to be missing.
  • Add an unknown deployment status for Pages/deployments without status data.
  • Render unknown deployment status with a neutral icon.
  • Add a changelog entry using {PR_MERGE_DATE}.

Validation

  • npm run lint
  • npm run build

Fixes #28848

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: cloudflare Issues related to the cloudflare extension platform: macOS platform: Windows labels Jun 24, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @Destiner @niklaswa @teziovsky @xmok @TakenMC @nbbaier @maximilianzuern you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="fix/cloudflare-pages-null-latest-stage"
FORK_URL="https://github.com/mralonsocorona/extensions.git"
EXTENSION_NAME="cloudflare"
REPO_NAME="extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days.

@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a crash in the Cloudflare "View Pages" command that occurred when a Pages project had no latest deployment (latest_deployment: null from the API).

  • Makes latest_deployment nullable in PageItem and adds optional chaining (latest_deployment?.latest_stage?.status ?? 'unknown') in formatPage to avoid the crash.
  • Adds 'unknown' to the DeploymentStatus union type and renders it with Icon.QuestionMarkCircle in getDeploymentStatusIcon, covering both the Pages list and individual deployment views.
  • Adds a changelog entry for the fix (though the entry uses a hardcoded date instead of {PR_MERGE_DATE}).

Confidence Score: 4/5

The code fix is correct and handles the null API response safely; only the changelog date format needs to be corrected before merging.

The null-safety changes in service.ts and utils.ts are well-implemented and correctly address the crash. The changelog entry uses a hardcoded date rather than the required template variable — the PR description itself notes the intent to use the placeholder, so this appears to be an oversight.

extensions/cloudflare/CHANGELOG.md — the date placeholder needs to be {PR_MERGE_DATE} instead of the hardcoded date.

Important Files Changed

Filename Overview
extensions/cloudflare/CHANGELOG.md New [Fix] entry added at the top, but uses a hardcoded date (2026-06-25) instead of the required {PR_MERGE_DATE} placeholder.
extensions/cloudflare/src/service.ts Correctly makes latest_deployment nullable and latest_stage nullable; formatPage and formatDeployment now use optional chaining with a fallback to 'unknown'.
extensions/cloudflare/src/utils.ts Adds the 'unknown' case to the getDeploymentStatusIcon switch, returning Icon.QuestionMarkCircle for projects/deployments without status data.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
extensions/cloudflare/CHANGELOG.md:3
The changelog entry uses a hardcoded date (`2026-06-25`) instead of the `{PR_MERGE_DATE}` template variable. Per the Raycast changelog convention, new entries must always use `{PR_MERGE_DATE}` so the merge date is automatically populated on release — the PR description even notes this intent.

```suggestion
## [Fix] - {PR_MERGE_DATE}
```

Reviews (2): Last reviewed commit: "Update CHANGELOG.md" | Re-trigger Greptile

@pernielsentikaer pernielsentikaer self-assigned this Jun 25, 2026

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit 4924a1d into raycast:main Jun 25, 2026
2 of 3 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Published to the Raycast Store:
https://raycast.com/destiner/cloudflare

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username (@mralonsocorona).

Please link your GitHub account to your Raycast account to receive your credits and soon be able to exchange them for some swag.

@@ -1,5 +1,9 @@
# Cloudflare Changelog

## [Fix] - 2026-06-25

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 The changelog entry uses a hardcoded date (2026-06-25) instead of the {PR_MERGE_DATE} template variable. Per the Raycast changelog convention, new entries must always use {PR_MERGE_DATE} so the merge date is automatically populated on release — the PR description even notes this intent.

Suggested change
## [Fix] - 2026-06-25
## [Fix] - {PR_MERGE_DATE}

Rule Used: What: Changelog entries must use {PR_MERGE_DATE}... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/cloudflare/CHANGELOG.md
Line: 3

Comment:
The changelog entry uses a hardcoded date (`2026-06-25`) instead of the `{PR_MERGE_DATE}` template variable. Per the Raycast changelog convention, new entries must always use `{PR_MERGE_DATE}` so the merge date is automatically populated on release — the PR description even notes this intent.

```suggestion
## [Fix] - {PR_MERGE_DATE}
```

**Rule Used:** What: Changelog entries must use `{PR_MERGE_DATE}`... ([source](https://app.greptile.com/raycast/-/custom-context?memory=c2214c11-df56-490a-b1c0-09a385df481a))

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

almatkai pushed a commit to almatkai/raymes-extensions that referenced this pull request Jul 13, 2026
* fix(cloudflare): handle pages without deployments

* Update CHANGELOG.md

---------

Co-authored-by: raycastbot <bot@raycast.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension: cloudflare Issues related to the cloudflare extension extension fix / improvement Label for PRs with extension's fix improvements platform: macOS platform: Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Cloudflare]...

3 participants