Compare commits
8 Commits
debug/prop
...
81b69ac6d5
| Author | SHA1 | Date | |
|---|---|---|---|
| 81b69ac6d5 | |||
| 513ae72e85 | |||
| 4c4dd1c515 | |||
| 46b15ed6ab | |||
| a015e72f7c | |||
|
|
d5df7d77a0 | ||
| ec3ceee862 | |||
| b024c5557c |
@@ -555,22 +555,20 @@ jobs:
|
|||||||
[[ "${NOOP:-0}" == "0" ]] || exit 0
|
[[ "${NOOP:-0}" == "0" ]] || exit 0
|
||||||
[[ -n "${BRANCH:-}" ]] || { echo "BRANCH unset -> skip PR"; exit 0; }
|
[[ -n "${BRANCH:-}" ]] || { echo "BRANCH unset -> skip PR"; exit 0; }
|
||||||
|
|
||||||
|
test -n "${FORGE_TOKEN:-}" || { echo "Missing FORGE_TOKEN"; exit 1; }
|
||||||
|
|
||||||
if [[ "${TARGET_COUNT:-0}" == "1" ]]; then
|
if [[ "${TARGET_COUNT:-0}" == "1" ]]; then
|
||||||
PR_TITLE="proposer: apply ticket #${TARGET_PRIMARY_ISSUE}"
|
PR_TITLE="proposer: apply ticket #${TARGET_PRIMARY_ISSUE}"
|
||||||
else
|
else
|
||||||
PR_TITLE="proposer: apply ${TARGET_COUNT} tickets on ${TARGET_CHEMIN}"
|
PR_TITLE="proposer: apply ${TARGET_COUNT} tickets on ${TARGET_CHEMIN}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export TITLE="$PR_TITLE"
|
export PR_TITLE TARGET_CHEMIN TARGET_ISSUES BRANCH END_SHA DEFAULT_BRANCH OWNER
|
||||||
export CHEMIN="$TARGET_CHEMIN"
|
|
||||||
export ISSUES="$TARGET_ISSUES"
|
|
||||||
export BRANCH="$BRANCH"
|
|
||||||
export END_SHA="${END_SHA:-unknown}"
|
|
||||||
export DEFAULT_BRANCH="$DEFAULT_BRANCH"
|
|
||||||
export OWNER="$OWNER"
|
|
||||||
|
|
||||||
node --input-type=module - <<'NODE' > /tmp/proposer.pr.json
|
node --input-type=module -e '
|
||||||
const issues = String(process.env.ISSUES || "")
|
import fs from "node:fs";
|
||||||
|
|
||||||
|
const issues = String(process.env.TARGET_ISSUES || "")
|
||||||
.trim()
|
.trim()
|
||||||
.split(/\s+/)
|
.split(/\s+/)
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
@@ -578,7 +576,7 @@ jobs:
|
|||||||
const body = [
|
const body = [
|
||||||
`PR auto depuis ticket${issues.length > 1 ? "s" : ""} ${issues.map((n) => `#${n}`).join(", ")} (state/approved).`,
|
`PR auto depuis ticket${issues.length > 1 ? "s" : ""} ${issues.map((n) => `#${n}`).join(", ")} (state/approved).`,
|
||||||
"",
|
"",
|
||||||
`- Chemin: ${process.env.CHEMIN || "(inconnu)"}`,
|
`- Chemin: ${process.env.TARGET_CHEMIN || "(inconnu)"}`,
|
||||||
"- Tickets:",
|
"- Tickets:",
|
||||||
...issues.map((n) => ` - #${n}`),
|
...issues.map((n) => ` - #${n}`),
|
||||||
`- Branche: ${process.env.BRANCH || ""}`,
|
`- Branche: ${process.env.BRANCH || ""}`,
|
||||||
@@ -587,14 +585,108 @@ jobs:
|
|||||||
"Merge si CI OK."
|
"Merge si CI OK."
|
||||||
].join("\n");
|
].join("\n");
|
||||||
|
|
||||||
process.stdout.write(JSON.stringify({
|
fs.writeFileSync(
|
||||||
title: process.env.TITLE || "proposer: apply tickets",
|
"/tmp/proposer.pr.json",
|
||||||
|
JSON.stringify({
|
||||||
|
title: process.env.PR_TITLE || "proposer: apply tickets",
|
||||||
body,
|
body,
|
||||||
base: process.env.DEFAULT_BRANCH || "main",
|
base: process.env.DEFAULT_BRANCH || "main",
|
||||||
head: `${process.env.OWNER}:${process.env.BRANCH}`,
|
head: `${process.env.OWNER}:${process.env.BRANCH}`,
|
||||||
allow_maintainer_edit: true
|
allow_maintainer_edit: true
|
||||||
}));
|
})
|
||||||
NODE
|
);
|
||||||
|
'
|
||||||
|
|
||||||
|
echo "Creating proposer PR..."
|
||||||
|
PR_JSON="$(curl -fsS -X POST \
|
||||||
|
-H "Authorization: token $FORGE_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"$API_BASE/api/v1/repos/$OWNER/$REPO/pulls" \
|
||||||
|
--data-binary @/tmp/proposer.pr.json)"
|
||||||
|
|
||||||
|
PR_URL="$(node --input-type=module -e 'const pr = JSON.parse(process.argv[1] || "{}"); console.log(pr.html_url || pr.url || "");' "$PR_JSON")"
|
||||||
|
|
||||||
|
test -n "$PR_URL" || {
|
||||||
|
echo "PR URL missing. Raw: $PR_JSON"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "PR created: $PR_URL"
|
||||||
|
|
||||||
|
for ISSUE in $TARGET_ISSUES; do
|
||||||
|
export ISSUE PR_URL
|
||||||
|
|
||||||
|
node --input-type=module -e '
|
||||||
|
import fs from "node:fs";
|
||||||
|
|
||||||
|
const issue = process.env.ISSUE || "";
|
||||||
|
const url = process.env.PR_URL || "";
|
||||||
|
const msg =
|
||||||
|
`PR proposer créée pour le ticket #${issue} : ${url}\n\n` +
|
||||||
|
`Le ticket est clôturé automatiquement ; la discussion peut se poursuivre dans la PR.`;
|
||||||
|
|
||||||
|
fs.writeFileSync(
|
||||||
|
"/tmp/proposer.issue.close.comment.json",
|
||||||
|
JSON.stringify({ body: msg })
|
||||||
|
);
|
||||||
|
'
|
||||||
|
|
||||||
|
echo "Commenting issue #$ISSUE ..."
|
||||||
|
COMMENT_HTTP="$(curl -sS -o /tmp/proposer.comment.out.json -w '%{http_code}' -X POST \
|
||||||
|
-H "Authorization: token $FORGE_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"$API_BASE/api/v1/repos/$OWNER/$REPO/issues/$ISSUE/comments" \
|
||||||
|
--data-binary @/tmp/proposer.issue.close.comment.json || true)"
|
||||||
|
echo "Issue #$ISSUE comment HTTP=$COMMENT_HTTP"
|
||||||
|
|
||||||
|
if [[ ! "$COMMENT_HTTP" =~ ^2 ]]; then
|
||||||
|
echo "Failed to comment issue #$ISSUE"
|
||||||
|
cat /tmp/proposer.comment.out.json || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Closing issue #$ISSUE ..."
|
||||||
|
CLOSE_HTTP="$(curl -sS -o /tmp/proposer.close.out.json -w '%{http_code}' -X PATCH \
|
||||||
|
-H "Authorization: token $FORGE_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"$API_BASE/api/v1/repos/$OWNER/$REPO/issues/$ISSUE" \
|
||||||
|
--data-binary '{"state":"closed"}' || true)"
|
||||||
|
echo "Issue #$ISSUE close HTTP=$CLOSE_HTTP"
|
||||||
|
|
||||||
|
if [[ ! "$CLOSE_HTTP" =~ ^2 ]]; then
|
||||||
|
echo "Failed to close issue #$ISSUE"
|
||||||
|
cat /tmp/proposer.close.out.json || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Verifying issue #$ISSUE state ..."
|
||||||
|
VERIFY_HTTP="$(curl -sS -o /tmp/proposer.verify.out.json -w '%{http_code}' \
|
||||||
|
-H "Authorization: token $FORGE_TOKEN" \
|
||||||
|
-H "Accept: application/json" \
|
||||||
|
"$API_BASE/api/v1/repos/$OWNER/$REPO/issues/$ISSUE" || true)"
|
||||||
|
echo "Issue #$ISSUE verify HTTP=$VERIFY_HTTP"
|
||||||
|
|
||||||
|
if [[ ! "$VERIFY_HTTP" =~ ^2 ]]; then
|
||||||
|
echo "Failed to re-read issue #$ISSUE after close"
|
||||||
|
cat /tmp/proposer.verify.out.json || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ISSUE_STATE="$(node --input-type=module -e '
|
||||||
|
import fs from "node:fs";
|
||||||
|
const j = JSON.parse(fs.readFileSync("/tmp/proposer.verify.out.json", "utf8"));
|
||||||
|
console.log(String(j.state || ""));
|
||||||
|
')"
|
||||||
|
|
||||||
|
echo "Issue #$ISSUE state=$ISSUE_STATE"
|
||||||
|
[[ "$ISSUE_STATE" == "closed" ]] || {
|
||||||
|
echo "Issue #$ISSUE is not closed after PATCH"
|
||||||
|
cat /tmp/proposer.verify.out.json || true
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "PR: $PR_URL"
|
||||||
|
|
||||||
PR_JSON="$(curl -fsS -X POST \
|
PR_JSON="$(curl -fsS -X POST \
|
||||||
-H "Authorization: token $FORGE_TOKEN" \
|
-H "Authorization: token $FORGE_TOKEN" \
|
||||||
@@ -602,10 +694,7 @@ jobs:
|
|||||||
"$API_BASE/api/v1/repos/$OWNER/$REPO/pulls" \
|
"$API_BASE/api/v1/repos/$OWNER/$REPO/pulls" \
|
||||||
--data-binary @/tmp/proposer.pr.json)"
|
--data-binary @/tmp/proposer.pr.json)"
|
||||||
|
|
||||||
PR_URL="$(node --input-type=module -e '
|
PR_URL="$(node --input-type=module -e 'const pr = JSON.parse(process.argv[1] || "{}"); console.log(pr.html_url || pr.url || "");' "$PR_JSON")"
|
||||||
const pr = JSON.parse(process.argv[1] || "{}");
|
|
||||||
console.log(pr.html_url || pr.url || "");
|
|
||||||
' "$PR_JSON")"
|
|
||||||
|
|
||||||
test -n "$PR_URL" || {
|
test -n "$PR_URL" || {
|
||||||
echo "PR URL missing. Raw: $PR_JSON"
|
echo "PR URL missing. Raw: $PR_JSON"
|
||||||
@@ -614,15 +703,21 @@ jobs:
|
|||||||
|
|
||||||
for ISSUE in $TARGET_ISSUES; do
|
for ISSUE in $TARGET_ISSUES; do
|
||||||
export ISSUE PR_URL
|
export ISSUE PR_URL
|
||||||
node --input-type=module - <<'NODE' > /tmp/proposer.issue.close.comment.json
|
|
||||||
|
node --input-type=module -e '
|
||||||
|
import fs from "node:fs";
|
||||||
|
|
||||||
const issue = process.env.ISSUE || "";
|
const issue = process.env.ISSUE || "";
|
||||||
const url = process.env.PR_URL || "";
|
const url = process.env.PR_URL || "";
|
||||||
const msg =
|
const msg =
|
||||||
`PR proposer created for ticket #${issue}: ${url}\n\n` +
|
`PR proposer créée pour le ticket #${issue} : ${url}\n\n` +
|
||||||
`The ticket is closed automatically. Discussion can continue in the PR.`;
|
`Le ticket est clôturé automatiquement ; la discussion peut se poursuivre dans la PR.`;
|
||||||
|
|
||||||
process.stdout.write(JSON.stringify({ body: msg }));
|
fs.writeFileSync(
|
||||||
NODE
|
"/tmp/proposer.issue.close.comment.json",
|
||||||
|
JSON.stringify({ body: msg })
|
||||||
|
);
|
||||||
|
'
|
||||||
|
|
||||||
curl -fsS -X POST \
|
curl -fsS -X POST \
|
||||||
-H "Authorization: token $FORGE_TOKEN" \
|
-H "Authorization: token $FORGE_TOKEN" \
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
{}
|
{
|
||||||
|
"/archicrat-ia/prologue/": {
|
||||||
|
"p-0-d7974f88": "p-0-e729df02"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ source:
|
|||||||
kind: docx
|
kind: docx
|
||||||
path: "sources/docx/archicrat-ia/Prologue—Archicratie-fondation_et_finalite_sociopolitique_et_historique-version_officielle.docx"
|
path: "sources/docx/archicrat-ia/Prologue—Archicratie-fondation_et_finalite_sociopolitique_et_historique-version_officielle.docx"
|
||||||
---
|
---
|
||||||
Nous vivons dans une époque saturée de diagnostics sur les formes de domination, les mutations du pouvoir, les détournements de la souveraineté. Depuis une vingtaine d’années, les appellations s’accumulent : *démocratie illibérale*, *ploutocratie*, *happycratie*, *gouvernement algorithmique*, *démocrature*… À travers ces tentatives de nommer le désordre du présent, un fait se répète, de manière sourde : la scène politique semble désorientée. Les catégories héritées — *État*, *pouvoir*, *représentation*, *volonté générale*, *contrat social* — apparaissent de moins en moins capables de décrire ce qui nous gouverne effectivement.
|
Nous vivons une époque saturée de diagnostics sur les formes de domination, les mutations du pouvoir, les détournements de la souveraineté. Depuis une vingtaine d’années, les appellations s’accumulent : démocratie illibérale, ploutocratie, happycratie, gouvernement algorithmique, démocrature… À travers ces tentatives de nommer le désordre du présent, un fait se répète, de manière sourde : la scène politique semble désorientée. Les catégories héritées — État, pouvoir, représentation, volonté générale, contrat social — apparaissent de moins en moins capables de décrire ce qui nous gouverne effectivement.
|
||||||
|
|
||||||
C’est cette perte de prise sur le réel que ce livre souhaite prendre au sérieux. Non pour lui ajouter un terme de plus au lexique fatigué des contre-pouvoirs ou des impuissances, mais pour repartir d’un point plus fondamental, presque en-deçà de la question politique classique. Ce point, c’est celui de la *tenue d’un monde commun* — c’est-à-dire la possibilité, pour des êtres dissemblables, vulnérables, inégaux, traversés de contradictions et situés dans des temporalités hétérogènes, de coexister sans s’annihiler.
|
C’est cette perte de prise sur le réel que ce livre souhaite prendre au sérieux. Non pour lui ajouter un terme de plus au lexique fatigué des contre-pouvoirs ou des impuissances, mais pour repartir d’un point plus fondamental, presque en-deçà de la question politique classique. Ce point, c’est celui de la *tenue d’un monde commun* — c’est-à-dire la possibilité, pour des êtres dissemblables, vulnérables, inégaux, traversés de contradictions et situés dans des temporalités hétérogènes, de coexister sans s’annihiler.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user