Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jonchurch
Copy link
Member

The Problem

It is not obvious that db.json and other files in this repo are autogenerated via a build step. (and a fetch step, for the datasource files).

It is too easy to open a PR with a diff that will be immediately undone the next time the build step is run and output committed

The solution

Have a CI step which checks if there is a diff after running npm run build. If there is, it indicates that db.json was edited by hand. Which we want to prevent. This won't catch manual edits to the data files like

  • apache-types.json
  • iana-types.json
  • nginx-types.json

but it is a good first line of defense.

Context

We should never have to leave review comments like #428 (review) while automation can prevent them passing CI

This wil be overwritten the next time we pull the automated changes (or when someoen else runs the build step, even without data updates)

To do changes that are not derived from the upstream datasources you must update the custom-types.js file, which is how we set compressible for text/yaml already, in addition to editing db.json.

So, update custom-types to include

'application/yaml': {
  compressible: true
}

Then run the build, without fetching the data again
npm run build

@jonchurch jonchurch merged commit 6bdee82 into master Jan 20, 2026
66 checks passed
@jonchurch jonchurch deleted the clean-build-ci branch January 20, 2026 16:32
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.

3 participants