Skip to content

feat: support change detection in config#592

Merged
AtomicFS merged 9 commits intomainfrom
feat/support-change-detection-in-config
Mar 4, 2025
Merged

feat: support change detection in config#592
AtomicFS merged 9 commits intomainfrom
feat/support-change-detection-in-config

Conversation

@AtomicFS
Copy link
Copy Markdown
Collaborator

@AtomicFS AtomicFS commented Feb 20, 2025

This PR adds the ability to firmware-action to detect changes in the JSON configuration file and re-build only the affected module (and possibly modules that depend on it).

And yeah, I know that simple checksum of the config file would do the job, but I just wanted to avoid running build on modules that do not need it. It will make firmware-action just a bit faster this way.

I did consider to save into a file only the small struct related to each module, but it was proving to be far too much work. So instead we save the whole configuration file (for each module separately) and only compare the relevant modules between these two configurations (between the snapshot saved in ./firmware-action and current config).

There is no test for this. At least not yet. Should I make a the test for this? I am kinda lazy. But I guess I should ... 😪

OK, I made a test for this. It is not very comprehensive, but I think it is good enough.

fixes #543
needs first #559

@github-actions github-actions bot added documentation Improvements or additions to documentation feature New feature or request testing Testing related github_actions Pull requests that update GitHub Actions code labels Feb 20, 2025
@AtomicFS AtomicFS force-pushed the feat/support-change-detection-in-config branch 5 times, most recently from ec78153 to a04aafd Compare February 21, 2025 13:36
@AtomicFS AtomicFS force-pushed the feat/support-change-detection-in-config branch from a04aafd to 7240786 Compare February 21, 2025 14:35
@AtomicFS AtomicFS added this to the v0.15.0 release milestone Feb 21, 2025
@AtomicFS AtomicFS changed the base branch from main to feat/support-multiple-configs February 21, 2025 15:45
@AtomicFS AtomicFS changed the base branch from feat/support-multiple-configs to main February 22, 2025 06:42
@AtomicFS AtomicFS force-pushed the feat/support-change-detection-in-config branch 3 times, most recently from 55da77a to b9c745a Compare February 28, 2025 18:04
@AtomicFS AtomicFS marked this pull request as ready for review February 28, 2025 18:15
@AtomicFS AtomicFS requested a review from MDr164 as a code owner February 28, 2025 18:15
@AtomicFS AtomicFS enabled auto-merge February 28, 2025 18:26
@AtomicFS AtomicFS force-pushed the feat/support-change-detection-in-config branch 3 times, most recently from 3eafdbe to 832ac6f Compare March 3, 2025 09:01
@AtomicFS AtomicFS force-pushed the feat/support-change-detection-in-config branch from 832ac6f to 02a237f Compare March 4, 2025 10:03
@github-actions github-actions bot added dependencies Pull requests that update a dependency file go Pull requests that update Go code labels Mar 4, 2025
@AtomicFS AtomicFS force-pushed the feat/support-change-detection-in-config branch from 02a237f to d1fc68d Compare March 4, 2025 10:04
@AtomicFS AtomicFS force-pushed the feat/support-change-detection-in-config branch from d1fc68d to 8e0289b Compare March 4, 2025 10:12
@AtomicFS AtomicFS requested a review from MDr164 March 4, 2025 10:14
@AtomicFS AtomicFS force-pushed the feat/support-change-detection-in-config branch from 8e0289b to 8559320 Compare March 4, 2025 11:12
@AtomicFS AtomicFS force-pushed the feat/support-change-detection-in-config branch from 8559320 to 45e15ed Compare March 4, 2025 13:39
@AtomicFS AtomicFS force-pushed the feat/support-change-detection-in-config branch from 45e15ed to 329c933 Compare March 4, 2025 14:00
@AtomicFS AtomicFS requested a review from MDr164 March 4, 2025 14:00
AtomicFS added 9 commits March 4, 2025 15:02
- function to create a safe name for file hopefully in any filesystem on
  any OS
- the module names are user-defined, and since we cannot grantee their
  sanity, we should sanitize them before using them as file names

Signed-off-by: AtomicFS <vojtech.vesely@9elements.com>
Signed-off-by: AtomicFS <vojtech.vesely@9elements.com>
Signed-off-by: AtomicFS <vojtech.vesely@9elements.com>
Signed-off-by: AtomicFS <vojtech.vesely@9elements.com>
AI-Generated: true
AI-Model: claude-3.5-sonnet
Signed-off-by: AtomicFS <vojtech.vesely@9elements.com>
- since we already have the Filenamify function, lets also use it for
  the time-stamps, to make it resilient to weird user-inputs

Signed-off-by: AtomicFS <vojtech.vesely@9elements.com>
Signed-off-by: AtomicFS <vojtech.vesely@9elements.com>
Signed-off-by: AtomicFS <vojtech.vesely@9elements.com>
- makes for easier debugging

Signed-off-by: AtomicFS <vojtech.vesely@9elements.com>
@AtomicFS AtomicFS force-pushed the feat/support-change-detection-in-config branch from 329c933 to ac7e3a2 Compare March 4, 2025 14:02
@AtomicFS AtomicFS added this pull request to the merge queue Mar 4, 2025
Merged via the queue into main with commit 330c67b Mar 4, 2025
69 checks passed
@AtomicFS AtomicFS deleted the feat/support-change-detection-in-config branch March 4, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation feature New feature or request github_actions Pull requests that update GitHub Actions code go Pull requests that update Go code module/coreboot testing Testing related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

detect changes in JSON config file to trigger re-builds

2 participants