chore: supprime l'intégration Zammad
parent
59da52854a
commit
88b4bf058c
|
@ -51,7 +51,6 @@ jobs:
|
|||
env:
|
||||
# Secrets of all kinds for fetching stats & releases
|
||||
GITHUB_API_SECRET: ${{ secrets.GITHUB_TOKEN }}
|
||||
ZAMMAD_API_SECRET_KEY: ${{ secrets.ZAMMAD_API_SECRET_KEY }}
|
||||
ATINTERNET_API_SECRET_KEY: ${{ secrets.ATINTERNET_API_SECRET_KEY }}
|
||||
ATINTERNET_API_ACCESS_KEY: ${{ secrets.ATINTERNET_API_ACCESS_KEY }}
|
||||
CRISP_API_IDENTIFIER: ${{ secrets.CRISP_API_IDENTIFIER }}
|
||||
|
@ -108,7 +107,6 @@ jobs:
|
|||
env:
|
||||
# Secrets of all kinds for fetching stats & releases
|
||||
GITHUB_API_SECRET: ${{ secrets.GITHUB_TOKEN }}
|
||||
ZAMMAD_API_SECRET_KEY: ${{ secrets.ZAMMAD_API_SECRET_KEY }}
|
||||
ATINTERNET_API_SECRET_KEY: ${{ secrets.ATINTERNET_API_SECRET_KEY }}
|
||||
ATINTERNET_API_ACCESS_KEY: ${{ secrets.ATINTERNET_API_ACCESS_KEY }}
|
||||
CRISP_API_IDENTIFIER: ${{ secrets.CRISP_API_IDENTIFIER }}
|
||||
|
|
|
@ -21,7 +21,6 @@ jobs:
|
|||
env:
|
||||
# Secrets of all kinds for fetching stats & releases
|
||||
GITHUB_API_SECRET: ${{ secrets.GITHUB_TOKEN }}
|
||||
ZAMMAD_API_SECRET_KEY: ${{ secrets.ZAMMAD_API_SECRET_KEY }}
|
||||
ATINTERNET_API_SECRET_KEY: ${{ secrets.ATINTERNET_API_SECRET_KEY }}
|
||||
ATINTERNET_API_ACCESS_KEY: ${{ secrets.ATINTERNET_API_ACCESS_KEY }}
|
||||
CRISP_API_IDENTIFIER: ${{ secrets.CRISP_API_IDENTIFIER }}
|
||||
|
|
|
@ -17,7 +17,6 @@ jobs:
|
|||
env:
|
||||
# Secrets of all kinds for fetching stats & releases
|
||||
GITHUB_API_SECRET: ${{ secrets.GITHUB_TOKEN }}
|
||||
ZAMMAD_API_SECRET_KEY: ${{ secrets.ZAMMAD_API_SECRET_KEY }}
|
||||
ATINTERNET_API_SECRET_KEY: ${{ secrets.ATINTERNET_API_SECRET_KEY }}
|
||||
ATINTERNET_API_ACCESS_KEY: ${{ secrets.ATINTERNET_API_ACCESS_KEY }}
|
||||
CRISP_API_IDENTIFIER: ${{ secrets.CRISP_API_IDENTIFIER }}
|
||||
|
|
|
@ -13,7 +13,6 @@ jobs:
|
|||
env:
|
||||
# Secrets of all kinds for fetching stats & releases
|
||||
GITHUB_API_SECRET: ${{ secrets.GITHUB_TOKEN }}
|
||||
ZAMMAD_API_SECRET_KEY: ${{ secrets.ZAMMAD_API_SECRET_KEY }}
|
||||
ATINTERNET_API_SECRET_KEY: ${{ secrets.ATINTERNET_API_SECRET_KEY }}
|
||||
ATINTERNET_API_ACCESS_KEY: ${{ secrets.ATINTERNET_API_ACCESS_KEY }}
|
||||
CRISP_API_IDENTIFIER: ${{ secrets.CRISP_API_IDENTIFIER }}
|
||||
|
@ -23,7 +22,6 @@ jobs:
|
|||
env:
|
||||
# Secrets of all kinds for fetching stats & releases
|
||||
GITHUB_API_SECRET: ${{ secrets.GITHUB_TOKEN }}
|
||||
ZAMMAD_API_SECRET_KEY: ${{ secrets.ZAMMAD_API_SECRET_KEY }}
|
||||
ATINTERNET_API_SECRET_KEY: ${{ secrets.ATINTERNET_API_SECRET_KEY }}
|
||||
ATINTERNET_API_ACCESS_KEY: ${{ secrets.ATINTERNET_API_ACCESS_KEY }}
|
||||
CRISP_API_IDENTIFIER: ${{ secrets.CRISP_API_IDENTIFIER }}
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
# This bot post a comment when issues with a given label are closed.
|
||||
name: Message du robot Zammad
|
||||
on:
|
||||
issues:
|
||||
types: [closed]
|
||||
|
||||
jobs:
|
||||
comment-when-issue-close:
|
||||
if: contains(github.event.issue.labels.*.name, '🏓 retour utilisateur')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Note: we could detect if the comment was already posted in the issue to
|
||||
# avoid posting it multiple times in case the issue was re-opened and
|
||||
# re-closed. https://github.com/peter-evans/create-or-update-comment
|
||||
- uses: peter-evans/create-or-update-comment@v3
|
||||
with:
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
body: |
|
||||
Ce ticket vient d'être fermé 🎉
|
||||
|
||||
Il est temps de prévenir les utilisateurs qui nous ont fait ce retour :
|
||||
https://mon-entreprise.zammad.com/#search/tags%3A%23${{ github.event.issue.number }}
|
||||
|
||||
Laissez un 👍 quand c'est fait !
|
|
@ -4,7 +4,6 @@ ALGOLIA_ADMIN_KEY=
|
|||
ATINTERNET_API_ACCESS_KEY=
|
||||
ATINTERNET_API_SECRET_KEY=
|
||||
DEEPL_API_SECRET=
|
||||
ZAMMAD_API_SECRET_KEY=
|
||||
SENTRY_AUTH_TOKEN=
|
||||
|
||||
# Utilisez votre propre token (voir issue en haut pour en créé un)
|
||||
|
|
|
@ -3,10 +3,10 @@ for = "/*"
|
|||
[headers.values]
|
||||
Content-Security-Policy = """\
|
||||
default-src 'self' mon-entreprise.fr; \
|
||||
style-src 'self' 'unsafe-inline' mon-entreprise.zammad.com; \
|
||||
connect-src 'self' *.incubateur.net raw.githubusercontent.com tm.urssaf.fr mon-entreprise.zammad.com recherche-entreprises.api.gouv.fr api.recherche-entreprises.fabrique.social.gouv.fr geo.api.gouv.fr *.algolia.net *.algolianet.com polyfill.io jedonnemonavis.numerique.gouv.fr user-images.githubusercontent.com; \
|
||||
form-action 'self' *.sibforms.com *.incubateur.net mon-entreprise.zammad.com; \
|
||||
script-src 'self' 'unsafe-inline' 'unsafe-eval' tm.urssaf.fr *.incubateur.net stonly.com code.jquery.com mon-entreprise.zammad.com polyfill.io; \
|
||||
style-src 'self' 'unsafe-inline'; \
|
||||
connect-src 'self' *.incubateur.net raw.githubusercontent.com tm.urssaf.fr recherche-entreprises.api.gouv.fr api.recherche-entreprises.fabrique.social.gouv.fr geo.api.gouv.fr *.algolia.net *.algolianet.com polyfill.io jedonnemonavis.numerique.gouv.fr user-images.githubusercontent.com; \
|
||||
form-action 'self' *.sibforms.com *.incubateur.net; \
|
||||
script-src 'self' 'unsafe-inline' 'unsafe-eval' tm.urssaf.fr *.incubateur.net stonly.com code.jquery.com polyfill.io; \
|
||||
img-src 'self' data: mon-entreprise.urssaf.fr tm.urssaf.fr user-images.githubusercontent.com github.com *.s3.amazonaws.com jedonnemonavis.numerique.gouv.fr; \
|
||||
frame-src 'self' https://www.youtube-nocookie.com https://codesandbox.io https://place-des-entreprises.beta.gouv.fr https://reso-staging.osc-fr1.scalingo.io https://stackblitz.com https://conseillers-entreprises.service-public.fr \
|
||||
"""
|
||||
|
|
|
@ -368,25 +368,9 @@ async function fetchCrispAnsweredConversationsLastMonth() {
|
|||
return conversations?.length ?? 0
|
||||
}
|
||||
|
||||
async function fetchZammadUserAnswersStats() {
|
||||
const ticketLists = await fetch(
|
||||
'https://mon-entreprise.zammad.com/api/v1/ticket_overviews?view=tickets_repondus_le_mois_dernier',
|
||||
{
|
||||
headers: new Headers({
|
||||
Authorization: `Token token=${process.env.ZAMMAD_API_SECRET_KEY}`,
|
||||
}),
|
||||
}
|
||||
)
|
||||
const answer = await ticketLists.json()
|
||||
return answer.index.count
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
async function fetchAllUserAnswerStats() {
|
||||
const zammadAnswersCount = await fetchZammadUserAnswersStats()
|
||||
const cripsAnswersCount = await fetchCrispAnsweredConversationsLastMonth()
|
||||
|
||||
return zammadAnswersCount + cripsAnswersCount
|
||||
return await fetchCrispAnsweredConversationsLastMonth()
|
||||
}
|
||||
|
||||
async function fetchGithubIssuesFromTags(tags) {
|
||||
|
@ -456,34 +440,11 @@ async function fetchCrispUserFeedbackIssues() {
|
|||
return issueCount
|
||||
}
|
||||
|
||||
async function fetchZammadUserFeedbackIssues() {
|
||||
const tags = await fetch(
|
||||
'https://mon-entreprise.zammad.com/api/v1/tag_list',
|
||||
{
|
||||
headers: new Headers({
|
||||
Authorization: `Token token=${process.env.ZAMMAD_API_SECRET_KEY}`,
|
||||
}),
|
||||
}
|
||||
).then((r) => r.json())
|
||||
|
||||
if (tags.error) {
|
||||
console.error('Zammad error: ' + JSON.stringify(tags))
|
||||
}
|
||||
|
||||
const issues = tags.filter(({ name }) => /#[\d]+/.exec(name))
|
||||
|
||||
return issues.reduce(
|
||||
(acc, { name, count }) => ({ ...acc, [name]: count }),
|
||||
{}
|
||||
)
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
async function fetchAllUserFeedbackIssues() {
|
||||
const crispFeedbackIssues = await fetchCrispUserFeedbackIssues()
|
||||
const zammadFeedbackIssues = await fetchZammadUserFeedbackIssues()
|
||||
|
||||
const allIssues = [crispFeedbackIssues, zammadFeedbackIssues]
|
||||
const allIssues = crispFeedbackIssues
|
||||
.flatMap((issues) => Object.entries(issues))
|
||||
.reduce(
|
||||
(acc, [issue, count]) => ({
|
||||
|
@ -540,7 +501,6 @@ writeInDataDir('stats.json', baseData)
|
|||
if (
|
||||
!process.env.ATINTERNET_API_ACCESS_KEY ||
|
||||
!process.env.ATINTERNET_API_SECRET_KEY ||
|
||||
!process.env.ZAMMAD_API_SECRET_KEY ||
|
||||
!process.env.CRISP_API_IDENTIFIER ||
|
||||
!process.env.CRISP_API_KEY ||
|
||||
!process.env.GITHUB_API_SECRET
|
||||
|
@ -550,7 +510,6 @@ if (
|
|||
`Variables d'environnement manquantes : ${[
|
||||
missingEnvVar('ATINTERNET_API_ACCESS_KEY'),
|
||||
missingEnvVar('ATINTERNET_API_SECRET_KEY'),
|
||||
missingEnvVar('ZAMMAD_API_SECRET_KEY'),
|
||||
missingEnvVar('CRISP_API_IDENTIFIER'),
|
||||
missingEnvVar('CRISP_API_KEY'),
|
||||
missingEnvVar('GITHUB_API_SECRET'),
|
||||
|
|
Loading…
Reference in New Issue