This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new bfa5051  Add a migration to use a temporary state subdirectory
bfa5051 is described below

commit bfa5051e3bd4283047ff7232f03cec7df329424a
Author: Sean B. Palmer <[email protected]>
AuthorDate: Mon Jan 19 20:03:25 2026 +0000

    Add a migration to use a temporary state subdirectory
---
 atr/docs/storage-interface.md | 6 +++---
 atr/server.py                 | 2 ++
 atr/util.py                   | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/atr/docs/storage-interface.md b/atr/docs/storage-interface.md
index b806e3b..befc07c 100644
--- a/atr/docs/storage-interface.md
+++ b/atr/docs/storage-interface.md
@@ -151,7 +151,7 @@ Only a small number of subdirectories of the state 
directory are written to by t
 * `downloads`, configured by `DOWNLOADS_STORAGE_DIR`
 * `finished`, configured by `FINISHED_STORAGE_DIR`
 * `subversion`, configured by `SVN_STORAGE_DIR`
-* `tmp`, which is unconfigurable
+* `temporary`, which is unconfigurable
 * `unfinished`, configured by `UNFINISHED_STORAGE_DIR`
 
 And the purposes of these directories is as follows. Note that "immutable" 
here means that existing files cannot be modified, but does not preclude new 
files from being added.
@@ -160,14 +160,14 @@ And the purposes of these directories is as follows. Note 
that "immutable" here
 * `downloads` [**mutable**] are hard links to released artifacts in the 
`finished` directory. The `finished` directory contains the files exactly as 
they were arranged by the release managers upon announcing the release, 
separated strictly into one directory per release. The `downloads` folder, on 
the other hand, has no restrictions on its organisation and can be rearranged.
 * `finished` [**immutable**, except for moving to external archive] contains, 
as mentioned above, all of the files of a release as they were when announced. 
This therefore constitutes an historical record and allows us to rewrite the 
hard links in the `downloads` directory without having to consider not 
accidentally deleting files by removing all references, etc.
 * `subversion` [**mutable**] is designed to mirror two subdirectories, `dev` 
and `release`, of `https://dist.apache.org/repos/dist`. This is currently 
unused.
-* `tmp` [**mutable**] holds temporary files during operations where the data 
cannot be modified in place. One important example is when creating a staging 
directory of a new revision. A subdirectory with a random name is made in this 
directory, and then the files in the prior version are hard linked into it. The 
modifications take place in this staging area before the directory is finalised 
and moved to `unfinished`.
+* `temporary` [**mutable**] holds temporary files during operations where the 
data cannot be modified in place. One important example is when creating a 
staging directory of a new revision. A subdirectory with a random name is made 
in this directory, and then the files in the prior version are hard linked into 
it. The modifications take place in this staging area before the directory is 
finalised and moved to `unfinished`.
 * `unfinished` [**immutable**, except for moving to `finished`] contains all 
of the files in a release before it is announced. In other words, when the 
release managers compose a release, when the committee votes on the release, 
and when the release has been voted on but not yet announced, the files for 
that release are in this directory.
 
 This list does not include any configuration files, logs, or log directories.
 
 ## How should the filesystem be backed up?
 
-Only the `attestable`, `downloads`, `finished`, and `unfinished` directories 
need to be backed up. The `subversion` directory is unused, and the `tmp` 
directory is for temporary staging.
+Only the `attestable`, `downloads`, `finished`, and `unfinished` directories 
need to be backed up. The `subversion` directory is unused, and the `temporary` 
directory is for temporary staging.
 
 The structure of the directories that need backing up is as follows. An 
ellipsis, `...`, means any number of further files or subdirectories containing 
subdirectories or files recursively.
 
diff --git a/atr/server.py b/atr/server.py
index 764794f..c149b59 100644
--- a/atr/server.py
+++ b/atr/server.py
@@ -84,6 +84,8 @@ _MIGRATIONS: Final[list[tuple[str, str]]] = [
     ("ssh_host_key", "secrets/generated/ssh_host_key"),
     # Subversion
     ("svn", "subversion"),
+    # Temporary
+    ("tmp", "temporary"),
 ]
 
 _SWAGGER_UI_TEMPLATE: Final[str] = """<!DOCTYPE html>
diff --git a/atr/util.py b/atr/util.py
index c796831..aa40a5c 100644
--- a/atr/util.py
+++ b/atr/util.py
@@ -487,7 +487,7 @@ async def get_release_stats(release: sql.Release) -> 
tuple[int, int, str]:
 
 def get_tmp_dir() -> pathlib.Path:
     # This must be on the same filesystem as the other state subdirectories
-    return pathlib.Path(config.get().STATE_DIR) / "tmp"
+    return pathlib.Path(config.get().STATE_DIR) / "temporary"
 
 
 def get_unfinished_dir() -> pathlib.Path:


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to