\r\n\n\n### Steps to reproduce\n\n.\n\n### Expected behavior\n\n_No response_\n\n### System Info\n\n```shell\n\"next-d126cf9e35\"\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Read the [docs](https://woodpecker-ci.org/docs/intro).\n- [X] Check that there isn't [already an issue](https://github.com/woodpecker-ci/woodpecker/issues) that reports the same bug to avoid creating a duplicate.\n- [X] Checked that the bug isn't fixed in the `next` version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]",[2009,2010],{"name":1985,"color":1986},{"name":2011,"color":2012},"ui","46DEA2",4677,"`tag` pipelines are missing avatar and commit title","2025-01-12T06:19:42Z","https://github.com/woodpecker-ci/woodpecker/issues/4677",0.7525576,{"description":2019,"labels":2020,"number":2024,"owner":1988,"repository":1989,"state":1990,"title":2025,"updated_at":2026,"url":2027,"score":2028},"### Component\n\nserver\n\n### Describe the bug\n\nWhile testing the ntfy plugin to send notifications after pipeline failure I wanted to use `CI_STEP_NAME` but it doesn't return a value. The other CI_STEP_* variables are not returning anything either.\r\n\r\nHere a example pipeline. I have added `CI_WORKFLOW_NAME` which does work.\r\n```\r\npipeline:\r\n deploy:\r\n image: alpine:latest\r\n commands:\r\n - exit 1\r\n\r\n notify_on_failure:\r\n image: codeberg.org/l-x/woodpecker-ntfy\r\n settings:\r\n url: https://ntfy.example.com/ci\r\n token:\r\n from_secret: ntfy_token\r\n title: Build failure\r\n priority: urgent\r\n icon: https://woodpecker-ci.org/img/logo.svg\r\n tags: x, robot\r\n message: >\r\n Workflow: ${CI_WORKFLOW_NAME}\r\n Step name: ${CI_STEP_NAME}\r\n Step status: ${CI_STEP_STATUS}\r\n Step started: ${CI_STEP_STARTED}\r\n Step finished: ${CI_STEP_FINISHED}\r\n when:\r\n status: [ failure ]\r\n```\n\n### System Info\n\n```shell\nVersion: next-02913fa7\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Read the [Contributing Guidelines](https://github.com/woodpecker-ci/woodpecker/blob/master/CONTRIBUTING.md).\n- [X] Read the [docs](https://woodpecker-ci.org/docs/intro).\n- [X] Check that there isn't [already an issue](https://github.com/woodpecker-ci/woodpecker/issues) that reports the same bug to avoid creating a duplicate.\n- [X] Checked that the bug isn't fixed in the `next` version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]\n- [X] Check that this is a concrete bug. For Q&A join our [Discord Chat Server](https://discord.gg/fcMQqSMXJy) or the [Matrix room](https://matrix.to/#/#woodpecker:matrix.org).",[2021],{"name":2022,"color":2023},"enhancement","7E1FE4",1760,"`CI_STEP_*` environment variables do not return values","2024-10-05T23:54:48Z","https://github.com/woodpecker-ci/woodpecker/issues/1760",0.7561649,{"description":2030,"labels":2031,"number":2036,"owner":1988,"repository":1989,"state":1990,"title":2037,"updated_at":2038,"url":2039,"score":2040},"### Component\n\nserver\n\n### Describe the bug\n\nError when enabling Gitea repository in Woodpecker CI:\n\n`could not create/update repo in store. error=\"pq: duplicate key value violates unique constraint \\\"UQE_repos_name\\\"\"`\n\nThere are no records with forge_id 0 in orgs table where we had similar problems\n\n### Steps to reproduce\n\n1. Press \"Enable\" in repository list\n2. Webhook is created\n3. Record in database can not be updated (possible tries to insert new one instead of updating?)\n\n### Expected behavior\n\n_No response_\n\n### System Info\n\n```shell\n{\"source\":\"https://github.com/woodpecker-ci/woodpecker\",\"version\":\"3.3.0\"}\n```\n\n### Additional context\n\nPostgreSQL database, Gitea forge integration\n\n### Validations\n\n- [x] Read the [docs](https://woodpecker-ci.org/docs/intro).\n- [x] Check that there isn't [already an issue](https://github.com/woodpecker-ci/woodpecker/issues) that reports the same bug to avoid creating a duplicate.\n- [x] Checked that the bug isn't fixed in the `next` version already [https://woodpecker-ci.org/versions]",[2032,2033],{"name":1985,"color":1986},{"name":2034,"color":2035},"server","5D7A92",4935,"Activating repository error that failed to activate becauce of UQE_repos_name constraint","2025-03-11T14:11:01Z","https://github.com/woodpecker-ci/woodpecker/issues/4935",0.7633461,{"description":2042,"labels":2043,"number":2046,"owner":1988,"repository":1989,"state":1990,"title":2047,"updated_at":2048,"url":2049,"score":2050},"https://ci.woodpecker-ci.org/repos/8987/pipeline/94/errors\r\n\r\nversion: current main",[2044,2045],{"name":1985,"color":1986},{"name":2034,"color":2035},4249,"[Bug] MultiForge: second forge can not be used","2024-10-25T17:33:00Z","https://github.com/woodpecker-ci/woodpecker/issues/4249",0.7655619,{"description":2052,"labels":2053,"number":2055,"owner":1988,"repository":1989,"state":2056,"title":2057,"updated_at":2058,"url":2059,"score":2060},"### Component\r\n\r\nagent\r\n\r\n### Describe the bug\r\n\r\nWhen having a backend error in the config, i.e. a malformed env var, the step and build are marked as successful even though they should be marked as \"failed\". \r\n\r\n\r\n\r\n\r\nk8s backend\r\n\r\n\r\n### System Info\r\n\r\n```shell\r\n{\"source\":\"https://github.com/woodpecker-ci/woodpecker\",\"version\":\"next-6ab9f802\"}\r\n```\r\n\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Read the [Contributing Guidelines](https://github.com/woodpecker-ci/woodpecker/blob/master/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://woodpecker-ci.org/docs/intro).\r\n- [X] Check that there isn't [already an issue](https://github.com/woodpecker-ci/woodpecker/issues) that reports the same bug to avoid creating a duplicate.\r\n- [X] Checked that the bug isn't fixed in the `next` version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]\r\n- [X] Check that this is a concrete bug. For Q&A join our [Discord Chat Server](https://discord.gg/fcMQqSMXJy) or the [Matrix room](https://matrix.to/#/#woodpecker:matrix.org).",[2054],{"name":1985,"color":1986},1871,"closed","Build is marked as \"successful\" although a backend error occurred","2025-01-10T21:25:48Z","https://github.com/woodpecker-ci/woodpecker/issues/1871",0.70291895,{"description":2062,"labels":2063,"number":2071,"owner":1988,"repository":1989,"state":2056,"title":2072,"updated_at":2073,"url":2074,"score":2075},"like the agent:\r\nhttps://github.com/woodpecker-ci/woodpecker/blob/205f8ecc1649ab48a9d5fb52b0ecd7b8c24abf4f/docker/Dockerfile.agent.multiarch#L21\r\n\r\nref https://docs.docker.com/engine/reference/builder/#healthcheck\r\n\r\nTODO:\r\n- [ ] add subcommand to server that can test against https://github.com/woodpecker-ci/woodpecker/blob/205f8ecc1649ab48a9d5fb52b0ecd7b8c24abf4f/server/router/router.go#L69\r\n- [ ] use subcommand in container",[2064,2065,2068],{"name":2034,"color":2035},{"name":2066,"color":2067},"feature","180DBE",{"name":2069,"color":2070},"good first issue","76ea72",1943,"Add an healthcheck to server container","2023-07-25T13:55:31Z","https://github.com/woodpecker-ci/woodpecker/issues/1943",0.72429824,{"description":2077,"labels":2078,"number":2080,"owner":1988,"repository":1989,"state":2056,"title":2081,"updated_at":2082,"url":2083,"score":2084},"### Clear and concise description of the problem\r\n\r\n`Woodpecker CI` could benefit from using some defaults to avoid repetitive blocks and/or references to anchors.\r\n\r\nThis is something I used to use in `GitLab CI` and it makes the pipeline really compact. For instance, they have a `default` keyword to configure some \"default\" values that apply to all subsequent steps — when relevant.\r\n\r\n### Suggested solution\r\n\r\n```yaml\r\ndefault:\r\n image: docker.io/library/rust:1.61-slim-bullseye\r\n\r\npipeline:\r\n format:\r\n commands:\r\n - rustup component add rustfmt\r\n - cargo fmt -- --check\r\n environment:\r\n CARGO_HOME: .cargo/\r\n group: verify\r\n # No need to specify image here since it's inferred by \"default\"\r\n assemble:\r\n commands:\r\n - cargo build\r\n environment:\r\n CARGO_HOME: .cargo/\r\n group: assemble\r\n # No need to specify image here since it's inferred by \"default\"\r\n publish:\r\n commands:\r\n - cargo blah\r\n environment:\r\n CARGO_HOME: .cargo/\r\n group: publish\r\n image: docker.io/library/rust:1.62-slim-bullseye # ...if defined, overwrites what's in default\r\n```\r\n\r\n### Alternative\r\n\r\nYAML aliases and anchors :unamused:\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Read the [Contributing Guidelines](https://github.com/woodpecker-ci/woodpecker/blob/master/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://woodpecker-ci.org/docs/intro).\r\n- [X] Check that there isn't already an [issue](https://github.com/woodpecker-ci/woodpecker/issues) that request the same feature to avoid creating a duplicate.",[2079],{"name":2066,"color":2067},946,"Global defaults for some keywords","2023-08-20T20:29:48Z","https://github.com/woodpecker-ci/woodpecker/issues/946",0.7401251,{"description":2086,"labels":2087,"number":2092,"owner":1988,"repository":1989,"state":2056,"title":2093,"updated_at":2094,"url":2095,"score":2096},"### Clear and concise description of the problem\r\n\r\nI'm trying to run a container image build step in my pipeline that uses [buildah](https://quay.io/repository/buildah/stable?tab=info). I'm running into a lot of permission errors like this:\r\n\r\n```\r\ntime=\"2023-10-07T19:59:26Z\" level=error msg=\"writing \\\"0 0 4294967295\\\\n\\\" to /proc/17/uid_map: write /proc/17/uid_map: operation not permitted\"\r\ntime=\"2023-10-07T19:59:26Z\" level=error msg=\"(Unable to determine exit status)\"\r\n```\r\n\r\nAfter some experimentation with podman and buildah containers on my cluster, I have determined that I need to configure a few different settings at the Pod level for this to work:\r\n\r\n- `metadata.annotations`: I need to be able to set `container.apparmor.security.beta.kubernetes.io/\u003Ccontainer_name>` to use a custom apparmor profile for my buildah container. I would like to use the `WOODPECKER_BACKEND_K8S_POD_ANNOTATIONS` env variable, but since the container names are randomly generated I'm not sure how to make this work.\r\n- `spec.securityContext`: The only way I have found to make buildah work is to run it as non-root. This means that I need to set `runAsUser`, `runAsGroup`, and `fsGroup` on the Pod level `securityContext` (not the container level).\r\n\r\n### Suggested solution\r\n\r\nAdding support for `securityContext` seems like it should be fairly straightforward. We could just follow that same approach that is currently used for `resources`, `nodeSelector`, etc. [documented here](https://woodpecker-ci.org/docs/next/administration/backends/kubernetes#resources).\r\n\r\nThe AppArmor profile is trickier since the container name needs to be included in the annotation key. I'm imagining a configuration like `backend_options.kubernetes.appArmorProfile` that could take all of the possible values for the annotation [documented here](https://kubernetes.io/docs/tutorials/security/apparmor/). Then, the pod generation logic would just look for this configuration and add the appropriate annotation if it's found.\r\n\r\n### Alternative\r\n\r\nI could disable AppArmor entirely, but that's not really advisable for a production environment. I could also try to find a way to get the buildah container running as root (it should be possible), but again, that's not ideal from a security perspective.\r\n\r\n### Additional context\r\n\r\nThis is somewhat of a follow up from #2510. I'm trying to get Woodpecker to run on my kubeadm/CRI-O based cluster running on Debian which I believe makes me some kind of leprechaun/unicorn/lochness monster. There definitely aren't many of us out there.\r\n\r\n### Validations\r\n\r\n- [X] Checked that the feature isn't part of the `next` version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]\r\n- [X] Read the [Contributing Guidelines](https://github.com/woodpecker-ci/woodpecker/blob/main/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://woodpecker-ci.org/docs/intro).\r\n- [X] Check that there isn't already an [issue](https://github.com/woodpecker-ci/woodpecker/issues) that request the same feature to avoid creating a duplicate.",[2088,2089],{"name":2022,"color":2023},{"name":2090,"color":2091},"backend/kubernetes","bfdadc",2545,"Support AppArmor annotations and securityContext in kubernetes backend","2024-01-12T22:32:26Z","https://github.com/woodpecker-ci/woodpecker/issues/2545",0.74469125,["Reactive",2098],{},["Set"],["ShallowReactive",2101],{"TRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"pFHQIFB42AdJrs5wDTvOaFsq1MmPjuO-uoqieHI6QmI":-1},"/woodpecker-ci/woodpecker/3801"]