dappnode / DNP_DAPPMANAGER

Dappnode package responsible for providing the Dappnode Package Manager
GNU General Public License v3.0
29 stars 35 forks source link

Fix `getPkgAsset` to return an array if multiple elements exist #1975

Closed Marketen closed 3 days ago

Marketen commented 5 days ago

closes https://github.com/dappnode/DAppNodePackage-DMS/issues/47 as part of the project https://github.com/orgs/dappnode/projects/72/views/1

getPkgAsset() now takes into account the "multiple" field of fileConfig parameter. If multiple == true and at least one file (here defined as IpfsEntry) passes the given name regex for the fileConfig, getPkgAsset() will return <T> as a json array, instead of a json object.

For example, dappnode exporter package has two files that end with grafana-dashboard.json. When the IPFS content of the package is downloaded, dappmanager will now notice that both files must be appended as an array, since we permit multiple grafana-dashboard.json to exist in a dnp, and both files pass the grafana-dashboard.json regex

Returning the content in grafana-dashboards.json as an array solves the DMS bug, since DMS's manager expects this content to be an array

github-actions[bot] commented 5 days ago

🚀 Deployed on https://6686af0a4948c218622e2b6f--objective-borg-9eeae5.netlify.app

github-actions[bot] commented 5 days ago

Dappnode bot has built and pinned the built packages to an IPFS node, for commit: 9657790bb535461b521e42797097f9b6490eb3ad

This is a development version and should only be installed for testing purposes.

(by dappnodebot/build-action)