diff --git a/CHANGELOG.md b/CHANGELOG.md index 44406fa005..58d5d40f9c 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * Move / Refactor / Split `CategoriesHeader` component * Split bundle into 3 chunks: main, vendor and cozy-bar +* Update Cozy App Publish (Fix travis icon on mattermost publish announcement) # 1.36.0 diff --git a/package.json b/package.json index f78cc0d461..2aec4bdd54 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "commitlint-config-cozy": "0.4.0", "copy-webpack-plugin": "5.0.4", "cozy-ach": "1.22.0", - "cozy-app-publish": "0.22.3", + "cozy-app-publish": "0.27.2", "cozy-jobs-cli": "1.9.13", "dummy-json": "2.0.0", "duplicate-package-checker-webpack-plugin": "3.0.0", diff --git a/src/targets/services/konnectorAlerts.js b/src/targets/services/konnectorAlerts.js index c51d24fd81..c1f7936452 100644 --- a/src/targets/services/konnectorAlerts.js +++ b/src/targets/services/konnectorAlerts.js @@ -70,16 +70,35 @@ const fetchRegistryInfo = memoize( ) const createTriggerAt = async (client, date) => { - await client.save({ - _type: TRIGGER_DOCTYPE, - type: '@at', - arguments: date.toISOString(), - worker: 'service', - message: { - name: 'konnectorAlerts', - slug: 'banks' - } - }) + logger( + 'info', + `Try to create new @at trigger for konnectorAlerts service at ${ + date.toISOString().split('T')[0] + }...` + ) + try { + await client.save({ + _type: TRIGGER_DOCTYPE, + type: '@at', + arguments: date.toISOString(), + worker: 'service', + message: { + name: 'konnectorAlerts', + slug: 'banks' + } + }) + logger( + 'info', + `⭐ Created: new @at trigger for konnectorAlerts service at ${ + date.toISOString().split('T')[0] + }` + ) + } catch (error) { + logger( + 'error', + `❗ Error when creating new @at trigger for konnectorAlerts service: ${error.message}` + ) + } } export const containerForTesting = { @@ -301,14 +320,36 @@ const main = async ({ client }) => { return } - logger('info', 'Executing job notifications service...') + const triggerId = process.env.COZY_TRIGGER_ID + const jobId = process.env.COZY_JOB_ID.split('/').pop() + + logger( + 'info', + `Executing job notifications service by trigger: ${triggerId}, job: ${jobId}...` + ) + + const serviceTrigger = triggerId + ? (await client.query(Q(TRIGGER_DOCTYPE).getById(triggerId))).data + : undefined - const serviceTrigger = process.env.COZY_TRIGGER_ID - ? (await client.query( - Q(TRIGGER_DOCTYPE).getById(process.env.COZY_TRIGGER_ID) - )).data + const serviceJob = jobId + ? (await client.query(Q(JOBS_DOCTYPE).getById(jobId))).data : undefined + // Used to execute a script on maif instance + // that force the execution of this service + // TODO should be removed after executing the script + if (serviceJob?.message?.forceIgnoredErrors) { + flag( + 'banks.konnector-alerts.ignored-errors', + serviceJob.message.forceIgnoredErrors + ) + logger( + 'info', + `Forced flag banks.konnector-alerts.ignored-errors to: ${serviceJob.message.forceIgnoredErrors}` + ) + } + await sendTriggerNotifications(client, serviceTrigger) await destroyObsoleteTrigger(client, serviceTrigger) } diff --git a/yarn.lock b/yarn.lock index 1d2be81258..92fb9ac522 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3864,6 +3864,11 @@ chownr@^1.0.1, chownr@^1.1.1: resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.2.tgz#a18f1e0b269c8a6a5d3c86eb298beb14c3dd7bf6" integrity sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A== +chownr@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" + integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== + chownr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" @@ -4690,20 +4695,20 @@ cozy-ach@1.22.0: server-destroy "^1.0.1" timezone "^1.0.22" -cozy-app-publish@0.22.3: - version "0.22.3" - resolved "https://registry.yarnpkg.com/cozy-app-publish/-/cozy-app-publish-0.22.3.tgz#4c45d1c3e2d36e4c00707633b1f68ea69b811725" - integrity sha512-zLxz0A/sbICa22Ti1Kp//v4zkZg3UIJoDrdfLYrZkFtTO+igL2Q4IqGUjCNCjjm3KsRcdk6aeh1i2fs6fmuZlw== +cozy-app-publish@0.27.2: + version "0.27.2" + resolved "https://registry.yarnpkg.com/cozy-app-publish/-/cozy-app-publish-0.27.2.tgz#5b81565733821bd74f7768b22e08343e58061817" + integrity sha512-mWoEsnhq6OsJMyIMR2uTnlU00Wvinpgsa+NJGHqcJ0nApaKOAek/5rZWrPZlrl91iskK5iL75Mie/GctVyvrbA== dependencies: argparse "^1.0.10" - chalk "2.4.2" - cross-spawn "6.0.5" - fs-extra "7.0.1" - lodash "4.17.15" - node-fetch "2.6.0" - prompt "1.0.0" - request "2.88.0" - tar "4.4.13" + chalk "^2.4.2" + cross-spawn "^6.0.5" + fs-extra "^7.0.1" + lodash "^4.17.19" + node-fetch "^2.6.1" + prompt "^1.0.0" + request "^2.88.0" + tar "^4.4.13" cozy-authentication@2.1.0: version "2.1.0" @@ -7876,7 +7881,7 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" -fs-extra@7.0.1: +fs-extra@7.0.1, fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== @@ -7892,6 +7897,13 @@ fs-minipass@^1.2.5: dependencies: minipass "^2.2.1" +fs-minipass@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" + integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== + dependencies: + minipass "^2.6.0" + fs-readdir-recursive@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" @@ -8477,7 +8489,7 @@ har-validator@~2.0.6: is-my-json-valid "^2.12.4" pinkie-promise "^2.0.0" -har-validator@~5.1.0, har-validator@~5.1.3: +har-validator@~5.1.3: version "5.1.5" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== @@ -12282,7 +12294,7 @@ minimist@~0.0.1: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= -minipass@^2.2.1, minipass@^2.8.6: +minipass@^2.2.1, minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== @@ -12297,6 +12309,13 @@ minizlib@^1.2.1: dependencies: minipass "^2.2.1" +minizlib@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" + integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== + dependencies: + minipass "^2.9.0" + mississippi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-2.0.0.tgz#3442a508fafc28500486feea99409676e4ee5a6f" @@ -12682,7 +12701,7 @@ mjml@4.3.1: mjml-validator "4.3.0" mjml-wrapper "4.3.1" -mkdirp@0.x.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.0, mkdirp@~0.5.1, mkdirp@~0.5.x: +mkdirp@0.x.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.0, mkdirp@~0.5.1, mkdirp@~0.5.x: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -15102,6 +15121,17 @@ prompt@1.0.0: utile "0.3.x" winston "2.1.x" +prompt@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/prompt/-/prompt-1.2.0.tgz#5d8f1d9011766bac07abde510dbf4338d87b4f02" + integrity sha512-iGerYRpRUg5ZyC+FJ/25G5PUKuWAGRjW1uOlhX7Pi3O5YygdK6R+KEaBjRbHSkU5vfS5PZCltSPZdDtUYwRCZA== + dependencies: + async "~0.9.0" + colors "^1.1.2" + read "1.0.x" + revalidator "0.1.x" + winston "2.x" + prompts@^2.0.1: version "2.1.0" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db" @@ -15173,7 +15203,7 @@ pseudomap@^1.0.1, pseudomap@^1.0.2: resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= -psl@^1.1.24, psl@^1.1.28: +psl@^1.1.28: version "1.2.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6" integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA== @@ -16488,32 +16518,6 @@ request@2.79.0, "request@>=2.9.0 <2.82.0": tunnel-agent "~0.4.1" uuid "^3.0.0" -request@2.88.0: - version "2.88.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" - integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.0" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.4.3" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - request@^2.40.0, request@^2.74.0, request@^2.78.0, request@^2.87.0, request@^2.88.0, request@^2.88.2: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" @@ -16861,6 +16865,11 @@ safe-buffer@5.1.2, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-buffer@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" @@ -18136,7 +18145,7 @@ tar@2.2.1, tar@^2.0.0, tar@~2.2.1: fstream "^1.0.2" inherits "2" -tar@4.4.13, tar@^4: +tar@^4: version "4.4.13" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== @@ -18149,6 +18158,19 @@ tar@4.4.13, tar@^4: safe-buffer "^5.1.2" yallist "^3.0.3" +tar@^4.4.13: + version "4.4.19" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" + integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== + dependencies: + chownr "^1.1.4" + fs-minipass "^1.2.7" + minipass "^2.9.0" + minizlib "^1.3.3" + mkdirp "^0.5.5" + safe-buffer "^5.2.1" + yallist "^3.1.1" + temp@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/temp/-/temp-0.4.0.tgz#671ad63d57be0fe9d7294664b3fc400636678a60" @@ -18502,14 +18524,6 @@ tough-cookie@~2.3.0: dependencies: punycode "^1.4.1" -tough-cookie@~2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" - integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== - dependencies: - psl "^1.1.24" - punycode "^1.4.1" - tr46@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" @@ -19584,6 +19598,18 @@ winston@2.1.x: pkginfo "0.3.x" stack-trace "0.0.x" +winston@2.x: + version "2.4.5" + resolved "https://registry.yarnpkg.com/winston/-/winston-2.4.5.tgz#f2e431d56154c4ea765545fc1003bd340c95b59a" + integrity sha512-TWoamHt5yYvsMarGlGEQE59SbJHqGsZV8/lwC+iCcGeAe0vUaOh+Lv6SYM17ouzC/a/LB1/hz/7sxFBtlu1l4A== + dependencies: + async "~1.0.0" + colors "1.0.x" + cycle "1.0.x" + eyes "0.1.x" + isstream "0.1.x" + stack-trace "0.0.x" + word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" @@ -19818,6 +19844,11 @@ yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== +yallist@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"