config
Configuration settings for GitHub synchronization service.
github_sync_settings
module-attribute
Global instance of GitHub sync settings.
GithubAppSettings
Bases: BaseSettings
Settings for GitHub App authentication.
Source code in src/horde_model_reference/sync/config.py
github_app_id
class-attribute
instance-attribute
GitHub App ID for authentication.
github_installation_id
class-attribute
instance-attribute
GitHub App Installation ID for the target organization/repository.
github_app_private_key
class-attribute
instance-attribute
GitHub App private key content in PEM format. Use this for inline key content.
github_app_private_key_path
class-attribute
instance-attribute
Path to GitHub App private key file (.pem). Use this to load key from a file.
is_configured
Check if GitHub App authentication is fully configured.
Returns:
-
bool–True if app_id, installation_id, and either private_key or private_key_path is set.
Source code in src/horde_model_reference/sync/config.py
get_private_key_content
Get the private key content, loading from file if necessary.
Returns:
-
str–The private key content in PEM format.
Raises:
-
ValueError–If neither private_key nor private_key_path is configured, or if both are set (mutually exclusive), or if file cannot be read.
Source code in src/horde_model_reference/sync/config.py
HordeGitHubSyncSettings
Bases: BaseSettings
Settings for syncing model references from PRIMARY to GitHub legacy repos.
Source code in src/horde_model_reference/sync/config.py
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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
model_config
class-attribute
instance-attribute
model_config = SettingsConfigDict(
env_prefix="HORDE_GITHUB_SYNC_",
use_attribute_docstrings=True,
)
suppress_meta_warnings
class-attribute
instance-attribute
Suppress pydantic meta warnings about unknown fields, for example, for use in scripts.
primary_api_url
class-attribute
instance-attribute
PRIMARY instance v1 API base URL (e.g., https://models.aihorde.net/). Required for sync to work.
primary_api_timeout
class-attribute
instance-attribute
Timeout in seconds for HTTP requests to PRIMARY API.
github_token
class-attribute
instance-attribute
GitHub personal access token with repo write permissions. Required for creating PRs. Set via HORDE_GITHUB_SYNC_GITHUB_TOKEN or GITHUB_TOKEN environment variable.
categories_to_sync
class-attribute
instance-attribute
Whitelist of categories to sync (e.g., ['image_generation', 'text_generation']). If None, syncs all available categories.
pr_reviewers
class-attribute
instance-attribute
Default GitHub usernames to assign as PR reviewers (e.g., ['username1', 'username2']).
pr_labels
class-attribute
instance-attribute
Default labels to apply to sync PRs.
pr_auto_assign_team
class-attribute
instance-attribute
GitHub team to auto-assign for review (e.g., 'org-name/team-name').
min_changes_threshold
class-attribute
instance-attribute
Minimum number of changes required to trigger PR creation.
sync_temp_dir
class-attribute
instance-attribute
Temporary directory for git operations. If None, uses system temp directory.
target_clone_dir
class-attribute
instance-attribute
Base directory for persistent repository clones. If set, repos will be cloned to {target_clone_dir}/{owner}/{repo}/ and reused across sync runs. The repository identity (owner/repo/branch) will be verified on each run and must match the configured github_image_repo, github_text_repo, and github_branch settings.
dry_run
class-attribute
instance-attribute
If True, perform comparison but don't create PRs. Useful for testing.
verbose_logging
class-attribute
instance-attribute
Enable detailed logging for sync operations.
watch_mode
class-attribute
instance-attribute
Enable watch mode to continuously monitor for metadata changes and trigger syncs.
watch_interval_seconds
class-attribute
instance-attribute
Interval in seconds between metadata checks in watch mode.
watch_initial_delay_seconds
class-attribute
instance-attribute
Initial delay in seconds before starting watch mode polling (useful for startup synchronization).
watch_enable_startup_sync
class-attribute
instance-attribute
If True, perform a full sync immediately when watch mode starts, before entering the watch loop.
validate_sync_configuration
Validate sync configuration and provide helpful warnings.
Source code in src/horde_model_reference/sync/config.py
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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | |
should_sync_category
Check if a category should be synced based on the whitelist.
Parameters:
-
category(MODEL_REFERENCE_CATEGORY) –The model reference category.
Returns:
-
bool–True if the category should be synced, False otherwise.