gitea.cli.watch.list
list
Report the issues that changed since the last watch run.
The command is built to be run on a schedule. On a tick where nothing changed it
prints nothing at all, so whatever wraps it - a cron entry mailing its output, a
script deciding whether to notify anyone - has nothing to forward and nothing to
act on. On a tick where something did, it prints one line per change, and
--output json gives the same changes as the envelope every other command
emits.
What it compares against is the cache described in gitea.watch.state, which it
updates as part of the run - before the report is written, so that a failure to
write it is reported as an error with nothing on stdout, as every other failure
in this CLI is.
--dry-run, spelled --no-advance for a caller who reads the cache as
something to advance rather than a run as something to rehearse, leaves the
cache exactly as it was, which makes the same changes come back on the next run.
It is what separates detecting a change from consuming it: a consumer that saw a
change but could not act on it - it was already busy, the run it would have
started was still in flight - leaves the cache where it is and meets the change
again, where a run that advanced it has quietly spent the only notification
there was going to be. Such a consumer commits the cache itself, once it has
acted, with gitea-cli watch advance.
Functions:
gitea.cli.watch.list.list_command
list_command(
ctx: Context,
owner: Annotated[
str,
Option(
"--owner",
help="Owner of the repositories and projects to watch.",
),
],
repository: Annotated[
list[str] | None,
Option(
"--repository",
help="Name of a repository to watch the open issues of. Repeat to watch several.",
),
] = None,
project_id: Annotated[
list[int] | None,
Option(
"--project-id",
help="ID of a project to watch the board of. Repeat to watch several.",
),
] = None,
state_file: Annotated[
str | None,
Option(
"--state-file",
envvar=STATE_FILE_ENV,
help="Path of the cache of issue snapshots. Defaults to the user cache directory.",
),
] = None,
dry_run: Annotated[
bool,
Option(
"--dry-run",
"--no-advance",
help="Report the changes without recording them, so the next run reports them again. Commit the cache once the changes have been acted on with 'gitea-cli watch advance'.",
),
] = False,
account_name: Annotated[
str | None,
Option(
"--account-name",
help="Name of the account to use for authentication.",
),
] = None,
token: Annotated[
str | None,
Option(
"--token",
help="Token for authentication. If not provided, the token from the specified account will be used.",
),
] = None,
base_url: Annotated[
str | None,
Option(
"--base-url",
help="Base URL of the Gitea platform. If not provided, the base URL from the specified account will be used.",
),
] = None,
) -> None
Report the issues that changed since the last run, and record the current state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
The Typer context. |
required |
owner
|
Annotated[str, Option('--owner', help='Owner of the repositories and projects to watch.')]
|
The owner of the repositories and projects to watch. |
required |
repository
|
Annotated[list[str] | None, Option('--repository', help='Name of a repository to watch the open issues of. Repeat to watch several.')]
|
The repositories to watch the open issues of. |
None
|
project_id
|
Annotated[list[int] | None, Option('--project-id', help='ID of a project to watch the board of. Repeat to watch several.')]
|
The projects to watch the board of. |
None
|
state_file
|
Annotated[str | None, Option('--state-file', envvar=STATE_FILE_ENV, help='Path of the cache of issue snapshots. Defaults to the user cache directory.')]
|
Path of the cache of issue snapshots. |
None
|
dry_run
|
Annotated[bool, Option('--dry-run', '--no-advance', help="Report the changes without recording them, so the next run reports them again. Commit the cache once the changes have been acted on with 'gitea-cli watch advance'.")]
|
Whether to leave the cache untouched. |
False
|
account_name
|
Annotated[str | None, Option('--account-name', help='Name of the account to use for authentication.')]
|
Name of the account to use for authentication. |
None
|
token
|
Annotated[str | None, Option('--token', help='Token for authentication. If not provided, the token from the specified account will be used.')]
|
Token for authentication. |
None
|
base_url
|
Annotated[str | None, Option('--base-url', help='Base URL of the Gitea platform. If not provided, the base URL from the specified account will be used.')]
|
Base URL of the Gitea platform. |
None
|
Source code in src/gitea/cli/watch/list.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |