Skip to content

Add lint rule ensuring that a publishing date is valid #7845

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

Open
mcollina opened this issue Jun 8, 2025 · 9 comments
Open

Add lint rule ensuring that a publishing date is valid #7845

mcollina opened this issue Jun 8, 2025 · 9 comments

Comments

@mcollina
Copy link
Member

mcollina commented Jun 8, 2025

#7838 had a publish date in the future for a reason - to not be published until that date.

We need better processes for this - plus the website should really not render blog post with a publish date in the future.

@avivkeller
Copy link
Member

Typically, if a PR isn’t meant to land until a specific date, the author adds the “on hold” label and clearly states that. I don’t see a strong reason to build logic into the site for such a niche use case.

When was the last time we actually needed to delay a blog post from being published immediately?

@bmuenzenmeyer
Copy link
Collaborator

IIRC we had some blog posts around the EOL CVEs that were staged, but i could be misremembering.

@ljharb
Copy link
Member

ljharb commented Jun 8, 2025

Every other blog system I’ve used doesn’t render a published post until the publish date is in the past - that’s how I’d expect it to work, and i wouldn’t consider it a niche use case personally.

@ovflowd
Copy link
Member

ovflowd commented Jun 8, 2025

Every other blog system I’ve used doesn’t render a published post until the publish date is in the past - that’s how I’d expect it to work, and i wouldn’t consider it a niche use case personally.

I agree with the expectation. It's just that on our system if we did that, it'd filter our these blog posts on preview. We could probably filter them on PROD. I also like the idea of ESlint rules.

@avivkeller
Copy link
Member

avivkeller commented Jun 8, 2025

We can add a lint warning that only turns into an error during merge_group?

That way it doesn't fail the PR, but does prevent it from landing

@mcollina
Copy link
Member Author

mcollina commented Jun 8, 2025

That would work!

@ovflowd
Copy link
Member

ovflowd commented Jun 8, 2025

We can add a lint warning that only turns into an error during merge_group?

That way it doesn't fail the PR, but does prevent it from landing

I rather fail the PR. And once the date is achieved, just rerun the CI.

@avivkeller avivkeller changed the title Do not publish articles with a time in the future Add lint rule ensuring that a publishing date is valid Jun 8, 2025
@avivkeller
Copy link
Member

avivkeller commented Jun 8, 2025

I don't think we need to fail the PR while it's still in development. A gentle reminder is more effective than a hard block at the PRs early stage. We only need to fail (and block) once it's going to be merged. Re-running the CI is an extra step we can avoid.

@Harkunwar
Copy link
Contributor

Should we just maybe make a bot to leave a comment on the PR that the publish date is a future date. This comment would need to be resolved to merge the PR anyway, so it will function as a warning without breaking our CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

6 participants