Skip to content
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

Automate via workflows. Add auto-archiving for downgrade. #581

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

Nerivec
Copy link
Collaborator

@Nerivec Nerivec commented Oct 28, 2024

Introduce the possibility to downgrade by archiving older images on changes (PR with new images, automatic download).
The images1 directory is used to store the downgrade images, and the index1.json file is used to store the related metadata.

Improve the processing of images through Github workflows:

  • Automatic PR validation for OTA files in images/<manufacturer>/*
    • Just need to put OTA files in a PR, the workflow does the rest (no manual changes to manifests, no manual script to run)
    • Automatic help from github bot via comments on problem
    • Automatic on PR merged update of manifests (with support for extra metas via PR body ```json ``` block - see README)
    • Automatic on PR merged sorting of OTA files if some need to go into images1 (downgrade)
    • Label ignore-ota-workflow can be used to skip the process (including above 2 'on PR merged' actions)
  • Automatic download of images (can be run on schedule) for supported manufacturers (currently: gmmts, ikea, inovelli, jethome, ledvance, lixee, salus, ubisys, xyzroe)
    • Automatic release creation, with release notes for each OTA file (if available) and changes from PRs (automatic from Github).
    • Uses a local cache (.cache directory) to prevent unnecessary executions.
  • Automatic use of CA certificates in cacerts directory as needed
    • cacerts.pem updated automatically on push to cacerts/**.
  • Ability to automatically re-process all images to identify broken links (file no longer exists, or manifests don't have file), update metadata on related source code change, etc..

The new metadata structure (non-breaking) for images is as below (see README for details on extra metas):

interface RepoImageMeta {
    //-- automatic from parsed image
    imageType: number;
    fileVersion: number;
    manufacturerCode: number;
    fileSize: number;
    otaHeaderString: string;
    //-- automatic from image file
    url: string;
    sha512: string;
    fileName: string;
    //-- extra metas
    force?: boolean;
    hardwareVersionMin?: number;
    hardwareVersionMax?: number;
    modelId?: string;
    manufacturerName?: string[];
    minFileVersion?: number;
    maxFileVersion?: number;
    originalUrl?: string;
    releaseNotes?: string;
}

See new README for more details.

@akx
Copy link

akx commented Nov 17, 2024

I just unpackaged & installed a Hue bulb that had 1.29.0_r21169 (20170908) firmware installed, and no updated firmware could be found for it.

I applied the workaround from Koenkk/zigbee2mqtt#8757, i.e. using an index.json from 9089fd7 to get the version bumped up to 20191218. Looks like this PR (or rather #582 that re-processed these files) has moved that firmware, fileVersion 16783874, to index1.json. Is z2m supposed to also pick up firmware for ancient devices from index1.json? 😅

@Nerivec
Copy link
Collaborator Author

Nerivec commented Nov 17, 2024

Should be fixed once current open PRs are merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-ota-workflow Do not run workflow to validate image files in PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants