Skip to content

Commit 001fb49

Browse files
committed
Merge remote-tracking branch 'origin/master' into staging-next
2 parents d3e6c8f + 35c52ab commit 001fb49

File tree

74 files changed

+1967
-1392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1967
-1392
lines changed

.github/workflows/codeowners.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ jobs:
2525
steps:
2626
- uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
2727

28+
- uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # v15
29+
if: github.repository_owner == 'NixOS'
30+
with:
31+
# This cache is for the nixpkgs repo checks and should not be trusted or used elsewhere.
32+
name: nixpkgs-ci
33+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
34+
2835
# Important: Because we use pull_request_target, this checks out the base branch of the PR, not the PR itself.
2936
# We later build and run code from the base branch with access to secrets,
3037
# so it's important this is not the PRs code.

.github/workflows/nixpkgs-vet.yml

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -26,52 +26,22 @@ jobs:
2626
# This should take 1 minute at most, but let's be generous. The default of 6 hours is definitely too long.
2727
timeout-minutes: 10
2828
steps:
29-
# This step has to be in this file, because it's needed to determine which revision of the repository to fetch, and we can only use other files from the repository once it's fetched.
29+
# This checks out the base branch because of pull_request_target
30+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
31+
with:
32+
path: base
33+
sparse-checkout: ci
3034
- name: Resolving the merge commit
3135
env:
3236
GH_TOKEN: ${{ github.token }}
3337
run: |
34-
# This checks for mergeability of a pull request as recommended in
35-
# https://docs.github.com/en/rest/guides/using-the-rest-api-to-interact-with-your-git-database?apiVersion=2022-11-28#checking-mergeability-of-pull-requests
36-
37-
# Retry the API query this many times
38-
retryCount=5
39-
# Start with 5 seconds, but double every retry
40-
retryInterval=5
41-
while true; do
42-
echo "Checking whether the pull request can be merged"
43-
prInfo=$(gh api \
44-
-H "Accept: application/vnd.github+json" \
45-
-H "X-GitHub-Api-Version: 2022-11-28" \
46-
/repos/"$GITHUB_REPOSITORY"/pulls/${{ github.event.pull_request.number }})
47-
mergeable=$(jq -r .mergeable <<< "$prInfo")
48-
mergedSha=$(jq -r .merge_commit_sha <<< "$prInfo")
49-
50-
if [[ "$mergeable" == "null" ]]; then
51-
if (( retryCount == 0 )); then
52-
echo "Not retrying anymore. It's likely that GitHub is having internal issues: check https://www.githubstatus.com/"
53-
exit 1
54-
else
55-
(( retryCount -= 1 )) || true
56-
57-
# null indicates that GitHub is still computing whether it's mergeable
58-
# Wait a couple seconds before trying again
59-
echo "GitHub is still computing whether this PR can be merged, waiting $retryInterval seconds before trying again ($retryCount retries left)"
60-
sleep "$retryInterval"
61-
62-
(( retryInterval *= 2 )) || true
63-
fi
64-
else
65-
break
66-
fi
67-
done
68-
69-
if [[ "$mergeable" == "true" ]]; then
70-
echo "The PR can be merged, checking the merge commit $mergedSha"
38+
if mergedSha=$(base/ci/get-merge-commit.sh ${{ github.repository }} ${{ github.event.number }}); then
39+
echo "Checking the merge commit $mergedSha"
7140
echo "mergedSha=$mergedSha" >> "$GITHUB_ENV"
7241
else
73-
echo "The PR cannot be merged, it has a merge conflict, skipping the rest.."
42+
echo "Skipping the rest..."
7443
fi
44+
rm -rf base
7545
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
7646
if: env.mergedSha
7747
with:

ci/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,58 @@ Why not just build the tooling right from the PRs Nixpkgs version?
4141
- Because it improves security, since we don't have to build potentially untrusted code from PRs.
4242
The tool only needs a very minimal Nix evaluation at runtime, which can work with [readonly-mode](https://nixos.org/manual/nix/stable/command-ref/opt-common.html#opt-readonly-mode) and [restrict-eval](https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-restrict-eval).
4343

44+
## `get-merge-commit.sh GITHUB_REPO PR_NUMBER`
45+
46+
Check whether a PR is mergeable and return the test merge commit as
47+
[computed by GitHub](https://docs.github.com/en/rest/guides/using-the-rest-api-to-interact-with-your-git-database?apiVersion=2022-11-28#checking-mergeability-of-pull-requests).
48+
49+
Arguments:
50+
- `GITHUB_REPO`: The repository of the PR, e.g. `NixOS/nixpkgs`
51+
- `PR_NUMBER`: The PR number, e.g. `1234`
52+
53+
Exit codes:
54+
- 0: The PR can be merged, the test merge commit hash is returned on stdout
55+
- 1: The PR cannot be merged because it's not open anymore
56+
- 2: The PR cannot be merged because it has a merge conflict
57+
- 3: The merge commit isn't being computed, GitHub is likely having internal issues, unknown if the PR is mergeable
58+
59+
### Usage
60+
61+
This script can be used in GitHub Actions workflows as follows:
62+
63+
```yaml
64+
on: pull_request_target
65+
66+
# We need a token to query the API, but it doesn't need any special permissions
67+
permissions: {}
68+
69+
jobs:
70+
build:
71+
name: Build
72+
runs-on: ubuntu-latest
73+
steps:
74+
# Important: Because of `pull_request_target`, this doesn't check out the PR,
75+
# but rather the base branch of the PR, which is needed so we don't run untrusted code
76+
- uses: actions/checkout@<VERSION>
77+
with:
78+
path: base
79+
sparse-checkout: ci
80+
- name: Resolving the merge commit
81+
env:
82+
GH_TOKEN: ${{ github.token }}
83+
run: |
84+
if mergedSha=$(base/ci/get-merge-commit.sh ${{ github.repository }} ${{ github.event.number }}); then
85+
echo "Checking the merge commit $mergedSha"
86+
echo "mergedSha=$mergedSha" >> "$GITHUB_ENV"
87+
else
88+
# Skipping so that no notifications are sent
89+
echo "Skipping the rest..."
90+
fi
91+
rm -rf base
92+
- uses: actions/checkout@<VERSION>
93+
# Add this to _all_ subsequent steps to skip them
94+
if: env.mergedSha
95+
with:
96+
ref: ${{ env.mergedSha }}
97+
- ...
98+
```

ci/get-merge-commit.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env bash
2+
# See ./README.md for docs
3+
4+
set -euo pipefail
5+
6+
log() {
7+
echo "$@" >&2
8+
}
9+
10+
if (( $# < 2 )); then
11+
log "Usage: $0 GITHUB_REPO PR_NUMBER"
12+
exit 99
13+
fi
14+
repo=$1
15+
prNumber=$2
16+
17+
# Retry the API query this many times
18+
retryCount=5
19+
# Start with 5 seconds, but double every retry
20+
retryInterval=5
21+
22+
while true; do
23+
log "Checking whether the pull request can be merged"
24+
prInfo=$(gh api \
25+
-H "Accept: application/vnd.github+json" \
26+
-H "X-GitHub-Api-Version: 2022-11-28" \
27+
"/repos/$repo/pulls/$prNumber")
28+
29+
# Non-open PRs won't have their mergeability computed no matter what
30+
state=$(jq -r .state <<< "$prInfo")
31+
if [[ "$state" != open ]]; then
32+
log "PR is not open anymore"
33+
exit 1
34+
fi
35+
36+
mergeable=$(jq -r .mergeable <<< "$prInfo")
37+
if [[ "$mergeable" == "null" ]]; then
38+
if (( retryCount == 0 )); then
39+
log "Not retrying anymore. It's likely that GitHub is having internal issues: check https://www.githubstatus.com/"
40+
exit 3
41+
else
42+
(( retryCount -= 1 )) || true
43+
44+
# null indicates that GitHub is still computing whether it's mergeable
45+
# Wait a couple seconds before trying again
46+
log "GitHub is still computing whether this PR can be merged, waiting $retryInterval seconds before trying again ($retryCount retries left)"
47+
sleep "$retryInterval"
48+
49+
(( retryInterval *= 2 )) || true
50+
fi
51+
else
52+
break
53+
fi
54+
done
55+
56+
if [[ "$mergeable" == "true" ]]; then
57+
log "The PR can be merged"
58+
jq -r .merge_commit_sha <<< "$prInfo"
59+
else
60+
log "The PR has a merge conflict"
61+
exit 2
62+
fi

nixos/modules/hardware/video/webcam/ipu6.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ in
2626

2727
config = mkIf cfg.enable {
2828

29-
# Module is upstream as of 6.10
30-
boot.extraModulePackages = with config.boot.kernelPackages;
31-
optional (kernelOlder "6.10") ipu6-drivers;
29+
# Module is upstream as of 6.10,
30+
# but still needs various out-of-tree i2c and the `intel-ipu6-psys` kernel driver
31+
boot.extraModulePackages = with config.boot.kernelPackages; [ ipu6-drivers ];
3232

3333
hardware.firmware = with pkgs; [
3434
ipu6-camera-bins

nixos/modules/services/desktop-managers/lomiri.nix

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ in {
1616
libayatana-common
1717
ubports-click
1818
]) ++ (with pkgs.lomiri; [
19-
content-hub
2019
hfd-service
2120
history-service
2221
libusermetrics
2322
lomiri
2423
lomiri-calculator-app
2524
lomiri-camera-app
2625
lomiri-clock-app
26+
lomiri-content-hub
2727
lomiri-docviewer-app
2828
lomiri-download-manager
2929
lomiri-filemanager-app
@@ -129,7 +129,7 @@ in {
129129

130130
environment.pathsToLink = [
131131
# Configs for inter-app data exchange system
132-
"/share/content-hub/peers"
132+
"/share/lomiri-content-hub/peers"
133133
# Configs for inter-app URL requests
134134
"/share/lomiri-url-dispatcher/urls"
135135
# Splash screens & other images for desktop apps launched via lomiri-app-launch
@@ -194,10 +194,6 @@ in {
194194
};
195195

196196
users.groups.usermetrics = { };
197-
198-
# TODO content-hub cannot pass files between applications without asking AA for permissions. And alot of the Lomiri stack is designed with AA availability in mind. This might be a requirement to be closer to upstream?
199-
# But content-hub currently fails to pass files between applications even with AA enabled, and we can get away without AA in many places. Let's see how this develops before requiring this for good.
200-
# security.apparmor.enable = true;
201197
};
202198

203199
meta.maintainers = lib.teams.lomiri.members;

0 commit comments

Comments
 (0)