comment action fails during job setup: apt cannot resolve Ubuntu mirrors in Docker build

Aperta
#29 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker, github-actions, powershell
Ambito
ci-cd, devops

Direzione di ricerca

Start by reading the comment action's Dockerfile and action.yml, then inspect clearOldComments.ps1 and the failing comment-on-pull-request workflow runs linked in the issue. Compare the proposed approaches and check how the tool action builds its image. Done means the comment action can set up reliably without depending on Ubuntu mirror DNS during each job.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

The comment action fails during Set up job on GitHub-hosted runners because its Dockerfile runs apt update / apt install at image build time, and the Ubuntu mirrors cannot be resolved from inside the Docker build. Since the failure happens while the action image is being built (before any step runs), continue-on-error: true on the consuming step does not apply, and the whole job fails.

This currently fails every pull request run of the surface-area-tests workflow in microsoft/kiota (the comment-on-pull-request jobs).

Evidence

Log excerpt:

#8 [4/7] RUN apt update &&    apt install -y curl gpg &&    apt clean;
#8 12.30   Could not resolve 'security.ubuntu.com'
#8 12.63   Could not resolve 'archive.ubuntu.com'
#8 12.65 W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease  Could not resolve 'archive.ubuntu.com'
#8 12.67 E: Unable to locate package curl
#8 12.67 E: Unable to locate package gpg
#8 ERROR: process "/bin/sh -c apt update &&    apt install -y curl gpg &&    apt clean;" did not complete successfully: exit code: 100
##[error]Docker build failed with exit code 1

Suggested fixes

Any of the following would remove the per-run dependency on the Ubuntu mirrors:

  1. Convert comment to a composite action that runs clearOldComments.ps1 with pwsh and the gh CLI already preinstalled on GitHub-hosted runners. No image build, no apt. (This is the approach microsoft/kiota#8586 takes inline.)
  2. Publish prebuilt images (e.g. to GHCR) and reference them from action.yml via image: docker://...@sha256:.... This also benefits the tool action, which currently compiles .NET on every run. It requires a publish workflow on main plus a scheduled rebuild to pick up base image and package security updates, and a process to bump the digest in action.yml.
  3. Pin the base image (mcr.microsoft.com/powershell is currently latest) regardless of the option chosen, to make builds reproducible.

Minor, while in there: clearOldComments.ps1 reads the comment with Get-Content (returns an array of lines) and passes it to gh pr comment -b; Get-Content -Raw or --body-file would preserve the file content as-is.

Lingua principale
C#
Stelle
0
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoftgraph/kiota-dom-export-diff-tool

Tutte le issue di microsoftgraph/kiota-dom-export-diff-tool

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.