Skip to content

Commit 7958742

Browse files
committed
Add a migration to use a subversion state subdirectory
1 parent 6694064 commit 7958742

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

atr/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class AppConfig:
9999
UNFINISHED_STORAGE_DIR = os.path.join(STATE_DIR, "unfinished")
100100
# TODO: By convention this is at /x1/, but we can symlink it here perhaps?
101101
# TODO: We need to get Puppet to check SVN out initially, or do it manually
102-
SVN_STORAGE_DIR = os.path.join(STATE_DIR, "svn")
102+
SVN_STORAGE_DIR = os.path.join(STATE_DIR, "subversion")
103103
ATTESTABLE_STORAGE_DIR = os.path.join(STATE_DIR, "attestable")
104104
SQLITE_DB_PATH = decouple.config("SQLITE_DB_PATH", default="database/atr.db")
105105
STORAGE_AUDIT_LOG_FILE = os.path.join(STATE_DIR, "audit", "storage-audit.log")

atr/docs/storage-interface.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Only a small number of subdirectories of the state directory are written to by t
150150
* `attestable`, configured by `ATTESTABLE_STORAGE_DIR`
151151
* `downloads`, configured by `DOWNLOADS_STORAGE_DIR`
152152
* `finished`, configured by `FINISHED_STORAGE_DIR`
153-
* `svn`, configured by `SVN_STORAGE_DIR`
153+
* `subversion`, configured by `SVN_STORAGE_DIR`
154154
* `tmp`, which is unconfigurable
155155
* `unfinished`, configured by `UNFINISHED_STORAGE_DIR`
156156

@@ -159,15 +159,15 @@ And the purposes of these directories is as follows. Note that "immutable" here
159159
* `attestable` [**immutable**] holds JSON files of data that ATR has automatically verified and which must now be held immutably. (We could store this data in the database, but the aim is to eventually write attestation files here, so this prepares for that approach.)
160160
* `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.
161161
* `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.
162-
* `svn` [**mutable**] is designed to mirror two subdirectories, `dev` and `release`, of `https://dist.apache.org/repos/dist`. This is currently unused.
162+
* `subversion` [**mutable**] is designed to mirror two subdirectories, `dev` and `release`, of `https://dist.apache.org/repos/dist`. This is currently unused.
163163
* `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`.
164164
* `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.
165165

166166
This list does not include any configuration files, logs, or log directories.
167167

168168
## How should the filesystem be backed up?
169169

170-
Only the `attestable`, `downloads`, `finished`, and `unfinished` directories need to be backed up. The `svn` directory is unused, and the `tmp` directory is for temporary staging.
170+
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.
171171

172172
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.
173173

atr/server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@
8282
("secrets.ini", "secrets/curated/secrets.ini"),
8383
("apptoken.txt", "secrets/generated/apptoken.txt"),
8484
("ssh_host_key", "secrets/generated/ssh_host_key"),
85+
# Subversion
86+
("svn", "subversion"),
8587
]
8688

8789
_SWAGGER_UI_TEMPLATE: Final[str] = """<!DOCTYPE html>

0 commit comments

Comments
 (0)