Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PrivateStorageio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PrivateStorage
PrivateStorageio
Compare revisions
2b01d479d81f91fd0713a58fd521a174f447abf7 to develop
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
privatestorage/PrivateStorageio
Select target project
No results found
develop
Select Git revision
Branches
118-borg-backup-not-running-as-it-should
125.dont-set-static-datasource-uids
125.silence-broken-backup-alerts
133.give-access-to-prod-infra
149.fix-bootloader
157.authorize-new-hro-key
162.flexible-grafana-module
163.jp-to-ben-for-prod
164.grafana-alert-rules
190-our-regular-updates-fill-up-the-servers-boot-partitions
207.payment-server-exception-reporting
287.publish-tahoe-error-rate
300.monitor-payment-server
352.cachix
42.update-nixpkgs
445.update-zkapauthorizer
62.openssl-111k
67.rationalize-morph-names.2
87.qemu-local-grid
87.test-local-grid
88.no-gui-for-qemu
also-alert-on-incoming-network-errors
develop
doc-fix
dont-use-etc-hosts
failsafe-payment-process
fix-repo-update-docs
flake
hro-cloud
localdev-qemu
make-sure-we-run-a-openzfs-compatible-kernel
meejah-develop-patch-44361
monitored-node
nixpkgs-upgrade-2022-07-13
nixpkgs-upgrade-2022-07-14
nixpkgs-upgrade-2022-07-22
nixpkgs-upgrade-2023-11-06
nixpkgs-upgrade-2024-02-12
nixpkgs-upgrade-2024-02-19
nixpkgs-upgrade-2024-02-26
nixpkgs-upgrade-2024-03-04
nixpkgs-upgrade-2024-03-11
nixpkgs-upgrade-2024-03-18
nixpkgs-upgrade-2024-03-25
nixpkgs-upgrade-2024-04-22
nixpkgs-upgrade-2024-05-13
nixpkgs-upgrade-2024-10-14
nixpkgs-upgrade-2024-12-23
nixpkgs-upgrade-2025-06-16
parallel-privatestorage-system-tests
payment-proxy-timeouts
per-node-monitor-config
production
reproduce-permission-errors
smaller-system-images
spending-node
spending-node-rebase
staging
upgrade-nixos-to-22.11_with-libvirt-localgrid
59 results
Swap
Target
tomprince/PrivateStorageio
Select target project
tomprince/PrivateStorageio
privatestorage/PrivateStorageio
2 results
2b01d479d81f91fd0713a58fd521a174f447abf7
Select Git revision
Branches
arion
develop
dont-use-etc-hosts
local-test-grid
no-morph-on-nodes
sec
simple-docs-build
simplify-grafana
stuff
9 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
tools/update-github-repo
+89
-0
89 additions, 0 deletions
tools/update-github-repo
tools/update-gitlab-repo
+89
-0
89 additions, 0 deletions
tools/update-gitlab-repo
tools/update-nixpkgs
+68
-0
68 additions, 0 deletions
tools/update-nixpkgs
with
246 additions
and
0 deletions
tools/update-github-repo
0 → 100755
View file @
196bfaff
#!/usr/bin/env python
"""
Update a pinned github repository.
Pass this path to a JSON file and it will update it to the latest
version of the branch it specifies. You can also pass a different
branch or repository owner, which will update the file to point at
the new branch/repository, and update to the latest version.
"""
import
argparse
import
json
from
pathlib
import
Path
import
httpx
from
ps_tools
import
get_url_hash
HASH_TYPE
=
"
sha512
"
ARCHIVE_TEMPLATE
=
"
https://api.github.com/repos/{owner}/{repo}/tarball/{rev}
"
BRANCH_TEMPLATE
=
(
"
https://api.github.com/repos/{owner}/{repo}/commits/{branch}
"
)
def
get_github_commit
(
config
):
response
=
httpx
.
get
(
BRANCH_TEMPLATE
.
format
(
**
config
))
response
.
raise_for_status
()
return
response
.
json
()[
"
sha
"
]
def
get_github_archive_url
(
config
):
return
ARCHIVE_TEMPLATE
.
format
(
**
config
)
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
parser
.
add_argument
(
"
repo_file
"
,
metavar
=
"
repo-file
"
,
type
=
Path
,
help
=
"
JSON file with pinned configuration.
"
,
)
parser
.
add_argument
(
"
--branch
"
,
type
=
str
,
help
=
"
Branch to update to.
"
,
)
parser
.
add_argument
(
"
--owner
"
,
type
=
str
,
help
=
"
Repository owner to update to.
"
,
)
parser
.
add_argument
(
"
--rev
"
,
type
=
str
,
help
=
"
Revision to pin.
"
,
)
parser
.
add_argument
(
"
--dry-run
"
,
action
=
"
store_true
"
,
)
args
=
parser
.
parse_args
()
repo_file
=
args
.
repo_file
config
=
json
.
loads
(
repo_file
.
read_text
())
for
key
in
[
"
owner
"
,
"
branch
"
]:
if
getattr
(
args
,
key
)
is
not
None
:
config
[
key
]
=
getattr
(
args
,
key
)
if
args
.
rev
is
not
None
:
config
[
"
rev
"
]
=
args
.
rev
else
:
config
[
"
rev
"
]
=
get_github_commit
(
config
)
archive_url
=
get_github_archive_url
(
config
)
config
.
update
(
get_url_hash
(
HASH_TYPE
,
"
source
"
,
archive_url
))
output
=
json
.
dumps
(
config
,
indent
=
2
)
if
args
.
dry_run
:
print
(
output
)
else
:
repo_file
.
write_text
(
output
)
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
tools/update-gitlab-repo
0 → 100755
View file @
196bfaff
#!/usr/bin/env python
"""
Update a pinned gitlab repository.
Pass this path to a JSON file and it will update it to the latest
version of the branch it specifies. You can also pass a different
branch or repository owner, which will update the file to point at
the new branch/repository, and update to the latest version.
"""
import
argparse
import
json
from
pathlib
import
Path
import
httpx
from
ps_tools
import
get_url_hash
HASH_TYPE
=
"
sha512
"
ARCHIVE_TEMPLATE
=
"
https://{domain}/api/v4/projects/{owner}%2F{repo}/repository/archive.tar.gz?sha={rev}
"
BRANCH_TEMPLATE
=
(
"
https://{domain}/api/v4/projects/{owner}%2F{repo}/repository/branches/{branch}
"
)
def
get_gitlab_commit
(
config
):
response
=
httpx
.
get
(
BRANCH_TEMPLATE
.
format
(
**
config
))
response
.
raise_for_status
()
return
response
.
json
()[
"
commit
"
][
"
id
"
]
def
get_gitlab_archive_url
(
config
):
return
ARCHIVE_TEMPLATE
.
format
(
**
config
)
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
parser
.
add_argument
(
"
repo_file
"
,
metavar
=
"
repo-file
"
,
type
=
Path
,
help
=
"
JSON file with pinned configuration.
"
,
)
parser
.
add_argument
(
"
--branch
"
,
type
=
str
,
help
=
"
Branch to update to.
"
,
)
parser
.
add_argument
(
"
--owner
"
,
type
=
str
,
help
=
"
Repository owner to update to.
"
,
)
parser
.
add_argument
(
"
--rev
"
,
type
=
str
,
help
=
"
Revision to pin.
"
,
)
parser
.
add_argument
(
"
--dry-run
"
,
action
=
"
store_true
"
,
)
args
=
parser
.
parse_args
()
repo_file
=
args
.
repo_file
config
=
json
.
loads
(
repo_file
.
read_text
())
for
key
in
[
"
owner
"
,
"
branch
"
]:
if
getattr
(
args
,
key
)
is
not
None
:
config
[
key
]
=
getattr
(
args
,
key
)
if
args
.
rev
is
not
None
:
config
[
"
rev
"
]
=
args
.
rev
else
:
config
[
"
rev
"
]
=
get_gitlab_commit
(
config
)
archive_url
=
get_gitlab_archive_url
(
config
)
config
.
update
(
get_url_hash
(
HASH_TYPE
,
"
source
"
,
archive_url
))
output
=
json
.
dumps
(
config
,
indent
=
2
)
if
args
.
dry_run
:
print
(
output
)
else
:
repo_file
.
write_text
(
output
)
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
tools/update-nixpkgs
0 → 100755
View file @
196bfaff
#!/usr/bin/env python
import
argparse
import
json
from
pathlib
import
Path
import
httpx
from
ps_tools
import
get_url_hash
# We pass this to builtins.fetchTarball which only supports sha256
HASH_TYPE
=
"
sha256
"
DEFAULT_CHANNEL
=
"
nixos-25.05
"
CHANNEL_URL_TEMPLATE
=
"
https://channels.nixos.org/{channel}/nixexprs.tar.xz
"
def
get_nixos_channel_url
(
*
,
channel
):
"""
Get the URL for the current release of the given nixos channel.
`https://channels.nixos.org/<channel>` redirects to the path on
`https://releases.nixos.org` that corresponds to the current release
of that channel. This captures that redirect, so we can pin against
the release.
"""
response
=
httpx
.
head
(
CHANNEL_URL_TEMPLATE
.
format
(
channel
=
channel
),
follow_redirects
=
False
)
assert
response
.
is_redirect
return
str
(
response
.
next_request
.
url
)
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
"
Update a pinned nixos repository.
"
)
parser
.
add_argument
(
"
repo_file
"
,
metavar
=
"
repo-file
"
,
nargs
=
"
?
"
,
default
=
Path
(
__file__
).
parent
.
with_name
(
"
nixpkgs.json
"
),
type
=
Path
,
help
=
"
JSON file with pinned configuration.
"
,
)
parser
.
add_argument
(
"
--dry-run
"
,
action
=
"
store_true
"
,
)
parser
.
set_defaults
(
channel
=
DEFAULT_CHANNEL
)
args
=
parser
.
parse_args
()
repo_file
=
args
.
repo_file
print
(
f
"
reading
{
repo_file
}
"
)
config
=
json
.
loads
(
repo_file
.
read_text
())
print
(
f
"
read
{
config
!r}
"
)
config
[
"
url
"
]
=
get_nixos_channel_url
(
channel
=
args
.
channel
)
hash_data
=
get_url_hash
(
HASH_TYPE
,
name
=
config
[
"
name
"
],
url
=
config
[
"
url
"
])
config
[
"
sha256
"
]
=
hash_data
[
"
outputHash
"
]
output
=
json
.
dumps
(
config
,
indent
=
2
)
if
args
.
dry_run
:
print
(
output
)
else
:
print
(
f
"
writing to
{
repo_file
}
"
)
repo_file
.
write_text
(
output
)
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
Prev
1
…
5
6
7
8
9
Next