Job status seems to be unavailable in workflow #12792

Closed
opened 2025-11-02 10:21:11 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @serious-angel on GitHub (Apr 7, 2024).

Description

Dear Developers,

Sincere gratitude for the ineffably awesome project!

Just to clarify, is it possible to access skipped(), failed() in jobs.<job_id>.if, or ${{ needs.job-id.result }} in Gitea? Or how would you determine the exact job's status using the context?

Please check out the following discussion at nektos/act:

Here in nektos/act needs.build-job.result is empty or undefined for skipped jobs.
success is set correctly after someone contributed it...
In gitea/act_runner it's the runner not assigning it properly
they have created their own single job mechanism that nektos/act doesn't support...

Source: https://github.com/nektos/act/discussions/2275#discussioncomment-9029872


Workflow test case
name: 'Deployment Workflow'

on:
  push:
    branches:
      - 'test'
      - 'releases/**'

jobs:

  environment-job:
    name: 'Environment'
    runs-on: 'ubuntu-latest'

    outputs:
      TEST: 'true'

    steps:
      - name: 'Environment Test'
        run: date;

  build-job:
    name: 'Build'
    runs-on: 'ubuntu-latest'
    needs: 'environment-job'
    if: ${{ needs.environment-job.outputs.TEST != 'true' }}

    steps:
      - name: 'Build Test'
        id: 'build-test'
        run: date;

  deploy-job:
    name: 'Deploy'
    runs-on: 'ubuntu-latest'
    needs: 'build-job'

    if: |
      always() &&
      (needs.build-job.result == 'success' || needs.build-job.result == 'skipped')

    steps:
      - name: 'Deploy Test'
        id: 'deploy-test'

        run: date;

In the result, the both jobs get skipped (e.g. attached Picture 1).


Regarding the logs, I am sorry, but I did not find proper ones, and those appear in Docker console only, even if configured in app.ini as:

; MODE = console
MODE = file
; Either "Trace", "Debug", "Info", "Warn", "Error" or "None", default is "Info"
LEVEL = Debug

Directory /data/gitea/log is empty, and only Action status probes are shown there it seems like 2024/04/07 13:44:12 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 172.25.0.1:57486, 200 OK in 210.0ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm) each second.


Where would be the exact source code location where the properties are set and checked to try to investigate, too?

Best and kind regards

Gitea Version

1.21.10

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Picture 1

image

Git Version

2.39.2

Operating System

Docker CLI in Linux x64

How are you running Gitea?

Docker Compose (+ some local networking)

services:

  gitea:
    image: gitea/gitea
    restart: unless-stopped
      
    ports:
      - 3020:3000
      - 3021:22

    depends_on:
      db:
        condition: service_healthy

    volumes:
      - '/volume1/docker/data/gitea/data/:/data/'

  gitea-actions-runner-1:
    image: 'gitea/act_runner'
    restart: unless-stopped

    environment:
      GITEA_RUNNER_NAME: "$GITEA_RUNNER_1_GITEA_RUNNER_NAME"
      GITEA_RUNNER_REGISTRATION_TOKEN: "$GITEA_RUNNER_1_GITEA_RUNNER_REGISTRATION_TOKEN"
      GITEA_INSTANCE_URL: "$GITEA_RUNNER_1_GITEA_INSTANCE_URL"
      GITEA_RUNNER_LABELS: "$GITEA_RUNNER_1_GITEA_RUNNER_LABELS"
      CONFIG_FILE: '/app/config.yaml'

    volumes:
      - '/volume1/docker/data/gitea/data/actions/runners/runner-1/config/config.yaml:/app/config.yaml'
      - '/volume1/docker/data/gitea/data/actions/runners/runner-1/data/:/data/'
      - '/var/run/docker.sock:/var/run/docker.sock'

    depends_on:
      - gitea

  db:
    image: 'bitnami/postgresql:latest'
    restart: unless-stopped

    environment:
      POSTGRESQL_USERNAME: "$DB_USERNAME"
      POSTGRESQL_PASSWORD: "$DB_PASSWORD"
      POSTGRESQL_DATABASE: "$DB_DATABASE"

    volumes:
      - '/volume1/docker/data/gitea/db/data:/bitnami/postgresql/data'

    healthcheck:
      test: pg_isready -h 127.0.0.1 -d "$DB_DATABASE" -U "$DB_USERNAME"
      interval: 10s
      timeout: 5s
      retries: 10
      start_period: 10s  

Database

PostgreSQL

Originally created by @serious-angel on GitHub (Apr 7, 2024). ### Description Dear Developers, Sincere gratitude for the ineffably awesome project! ✨ Just to clarify, is it possible to access `skipped()`, `failed()` in `jobs.<job_id>.if`, or `${{ needs.job-id.result }}` in Gitea? Or how would you determine the exact job's status using the context? Please check out the following discussion at `nektos/act`: > Here in `nektos/act` `needs.build-job.result` is empty or undefined for skipped jobs. success is set correctly after someone contributed it... > In `gitea/act_runner` it's the runner not assigning it properly they have created their own single job mechanism that `nektos/act` doesn't support... Source: https://github.com/nektos/act/discussions/2275#discussioncomment-9029872 --- <details> <summary>Workflow test case</summary> ```yaml name: 'Deployment Workflow' on: push: branches: - 'test' - 'releases/**' jobs: environment-job: name: 'Environment' runs-on: 'ubuntu-latest' outputs: TEST: 'true' steps: - name: 'Environment Test' run: date; build-job: name: 'Build' runs-on: 'ubuntu-latest' needs: 'environment-job' if: ${{ needs.environment-job.outputs.TEST != 'true' }} steps: - name: 'Build Test' id: 'build-test' run: date; deploy-job: name: 'Deploy' runs-on: 'ubuntu-latest' needs: 'build-job' if: | always() && (needs.build-job.result == 'success' || needs.build-job.result == 'skipped') steps: - name: 'Deploy Test' id: 'deploy-test' run: date; ``` </details> In the result, the both jobs get skipped (e.g. attached `Picture 1`). --- Regarding the logs, I am sorry, but I did not find proper ones, and those appear in Docker console only, even if configured in `app.ini` as: ```ini ; MODE = console MODE = file ; Either "Trace", "Debug", "Info", "Warn", "Error" or "None", default is "Info" LEVEL = Debug ``` Directory `/data/gitea/log` is empty, and only Action status probes are shown there it seems like `2024/04/07 13:44:12 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 172.25.0.1:57486, 200 OK in 210.0ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)` each second. --- Where would be the exact source code location where the properties are set and checked to try to investigate, too? Best and kind regards ### Gitea Version 1.21.10 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots # Picture 1 ![image](https://github.com/nektos/act/assets/25136754/edbf1fb7-bf56-40c5-9c37-cd9993b8afb8) ### Git Version 2.39.2 ### Operating System Docker CLI in Linux x64 ### How are you running Gitea? # Docker Compose (+ some local networking) ```yaml services: gitea: image: gitea/gitea restart: unless-stopped ports: - 3020:3000 - 3021:22 depends_on: db: condition: service_healthy volumes: - '/volume1/docker/data/gitea/data/:/data/' gitea-actions-runner-1: image: 'gitea/act_runner' restart: unless-stopped environment: GITEA_RUNNER_NAME: "$GITEA_RUNNER_1_GITEA_RUNNER_NAME" GITEA_RUNNER_REGISTRATION_TOKEN: "$GITEA_RUNNER_1_GITEA_RUNNER_REGISTRATION_TOKEN" GITEA_INSTANCE_URL: "$GITEA_RUNNER_1_GITEA_INSTANCE_URL" GITEA_RUNNER_LABELS: "$GITEA_RUNNER_1_GITEA_RUNNER_LABELS" CONFIG_FILE: '/app/config.yaml' volumes: - '/volume1/docker/data/gitea/data/actions/runners/runner-1/config/config.yaml:/app/config.yaml' - '/volume1/docker/data/gitea/data/actions/runners/runner-1/data/:/data/' - '/var/run/docker.sock:/var/run/docker.sock' depends_on: - gitea db: image: 'bitnami/postgresql:latest' restart: unless-stopped environment: POSTGRESQL_USERNAME: "$DB_USERNAME" POSTGRESQL_PASSWORD: "$DB_PASSWORD" POSTGRESQL_DATABASE: "$DB_DATABASE" volumes: - '/volume1/docker/data/gitea/db/data:/bitnami/postgresql/data' healthcheck: test: pg_isready -h 127.0.0.1 -d "$DB_DATABASE" -U "$DB_USERNAME" interval: 10s timeout: 5s retries: 10 start_period: 10s ``` ### Database PostgreSQL
GiteaMirror added the topic/gitea-actionstype/bug labels 2025-11-02 10:21:11 -06:00
Author
Owner

@yp05327 commented on GitHub (Apr 8, 2024):

Test result in GitHub:
https://github.com/yp05327/test2/actions/runs/8596056322/job/23551892849
It seems that this is an issue of Gitea side.

@yp05327 commented on GitHub (Apr 8, 2024): Test result in GitHub: https://github.com/yp05327/test2/actions/runs/8596056322/job/23551892849 It seems that this is an issue of Gitea side.
Author
Owner

@yp05327 commented on GitHub (Apr 8, 2024):

related: #29464
didn't considering complex if condition:
image

As a simple example, if you convert it into always = strings.Contains(expr, "always()")
Then you can see the correct result:
image
So we need to analysis this if condition here.

And, it is not related to needs.job-id.result, act runner can correctly handle it.

@yp05327 commented on GitHub (Apr 8, 2024): related: #29464 didn't considering complex `if` condition: ![image](https://github.com/go-gitea/gitea/assets/18380374/fdd3b172-2d32-4cdf-8479-fd16c5718dd6) As a simple example, if you convert it into `always = strings.Contains(expr, "always()")` Then you can see the correct result: ![image](https://github.com/go-gitea/gitea/assets/18380374/18bb0bf7-714b-441d-9e3a-0a3915bf1b9a) So we need to analysis this `if` condition here. And, it is not related to `needs.job-id.result`, act runner can correctly handle it.
Author
Owner

@lunny commented on GitHub (Apr 8, 2024):

We need an express evaluate DSL.

@lunny commented on GitHub (Apr 8, 2024): We need an express evaluate DSL.
Author
Owner

@yp05327 commented on GitHub (Apr 8, 2024):

I'm not sure whether we need to completely/correctly get the result of the condition, as maybe it is hard to calculate it from Gitea side.
So maybe we only need to detect whether always() function is used in it, and then just run it, because act runner can handle it.
e.g.
image

@yp05327 commented on GitHub (Apr 8, 2024): I'm not sure whether we need to completely/correctly get the result of the condition, as maybe it is hard to calculate it from Gitea side. So maybe we only need to detect whether `always()` function is used in it, and then just run it, because act runner can handle it. e.g. ![image](https://github.com/go-gitea/gitea/assets/18380374/a30ff71c-dc81-4794-b2a8-287dcf423a01)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12792