Skip to content

Update Hashnode publish sheet recovery - #5522

Merged
shai-almog merged 1 commit into
masterfrom
fix-hashnode-publish-sheet
Aug 5, 2026
Merged

Update Hashnode publish sheet recovery#5522
shai-almog merged 1 commit into
masterfrom
fix-hashnode-publish-sheet

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Summary

  • update Hashnode automation for the current Radix publish-settings sheet
  • keep tag autocomplete from closing the sheet and verify the exact five tags
  • require canonical attribution before publishing
  • verify the public publication-domain article when Hashnode redirects to an authenticated edit URL

Validation

  • PYTHONDONTWRITEBYTECODE=1 python3 scripts/website/test_syndicate_browser_posts.py
  • PYTHONDONTWRITEBYTECODE=1 python3 scripts/website/test_syndication_health.py
  • PYTHONDONTWRITEBYTECODE=1 python3 scripts/website/test_syndicate_blog_posts.py
  • live scoped recovery published compact-strings-parparvm; public sitemap, canonical URL, and all five tags verified

Copilot AI lite review requested due to automatic review settings August 5, 2026 02:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5fa2e1839

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


@staticmethod
def _wait_for_public_article(public_url: str, canonical_url: str) -> bool:
deadline = time.time() + 45

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Import time before verifying Hashnode edit redirects

When Hashnode redirects a successful publish to /edit (the new path handled above), _publish_from_dialog calls _wait_for_public_article, but this method calls time.time()/time.sleep() without importing time. A direct call raises NameError, which submit_draft treats as a failed publish and then records no completed URL, so a live-published article can be reported as failed and retried/duplicated on the next run.

Useful? React with 👍 / 👎.

Copilot AI left a comment

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.

Pull request overview

Updates the Hashnode Playwright-based syndication flow to match the current Radix publish side-sheet UI, enforce canonical attribution + tag verification prior to publishing, and correctly handle Hashnode’s post-publish redirect behavior (authenticated /edit/... instead of the public article URL).

Changes:

  • Treat Hashnode /draft/... and /edit/... URLs as unpublished results when persisting publish state.
  • Update publish-dialog selectors and tag/canonical setting logic to work within the open Radix dialog/sheet and prevent Escape from closing the sheet.
  • When Hashnode redirects to an authenticated edit URL after publishing, derive the expected public URL from the Discovery tab and verify it’s publicly reachable with the correct canonical before recording it.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
scripts/website/syndicate_browser_posts.py Updates Hashnode publish workflow (selectors, tag/canonical verification gates, and public-URL verification after edit redirect).
scripts/website/test_syndicate_browser_posts.py Adds unit assertions covering the new Hashnode completion rules and key automation safeguards (selectors, publish gating, no Escape during tag entry).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1092 to +1094
def _wait_for_public_article(public_url: str, canonical_url: str) -> bool:
deadline = time.time() + 45
request = urllib.request.Request(public_url, headers={"User-Agent": _UA_STR})
Comment on lines 1118 to 1122
@@ -1058,14 +1121,10 @@ def _set_canonical_url(self, page, canonical_url: str, mod: str) -> bool:
# earlier syndication) is already in the field. Select-all
# + type generates real key events so React picks up the
)
return f"{self.PUBLICATION_URL}/{match.group(1)}"

def _set_tags(self, page, mod: str) -> bool:
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog
shai-almog merged commit 0e978e0 into master Aug 5, 2026
12 checks passed
@shai-almog
shai-almog deleted the fix-hashnode-publish-sheet branch August 5, 2026 06:03
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.

2 participants