client
appimage_updater.repositories.gitlab.client
¶
GitLab API client for AppImage Updater.
This module provides a GitLab API v4 client for fetching release information, supporting both gitlab.com and self-hosted GitLab instances.
GitLabClient(timeout=30, user_agent=None, auth=None)
¶
GitLab API v4 client for release information.
Supports: - GitLab.com and self-hosted GitLab instances - Personal access token authentication - Release and project information fetching - Rate limiting and error handling
Parameters:
Name | Type | Description | Default |
---|---|---|---|
timeout
|
int
|
Request timeout in seconds |
30
|
user_agent
|
str | None
|
Custom user agent string |
None
|
auth
|
GitLabAuth | None
|
GitLabAuth instance for authentication |
None
|
Source code in src/appimage_updater/repositories/gitlab/client.py
auth = auth or GitLabAuth()
instance-attribute
¶
timeout = timeout
instance-attribute
¶
user_agent = user_agent or self._get_default_user_agent()
instance-attribute
¶
get_latest_release(owner, repo, base_url='https://gitlab.com')
async
¶
Get the latest release for a GitLab project.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
owner
|
str
|
Project owner/namespace |
required |
repo
|
str
|
Repository name |
required |
base_url
|
str
|
GitLab instance base URL |
'https://gitlab.com'
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Latest release information dictionary |
Raises:
Type | Description |
---|---|
GitLabClientError
|
If the API request fails or no releases found |
Source code in src/appimage_updater/repositories/gitlab/client.py
get_releases(owner, repo, base_url='https://gitlab.com', limit=10)
async
¶
Get recent releases for a GitLab project.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
owner
|
str
|
Project owner/namespace |
required |
repo
|
str
|
Repository name |
required |
base_url
|
str
|
GitLab instance base URL |
'https://gitlab.com'
|
limit
|
int
|
Maximum number of releases to fetch |
10
|
Returns:
Type | Description |
---|---|
list[dict[str, Any]]
|
List of release information dictionaries |
Raises:
Type | Description |
---|---|
GitLabClientError
|
If the API request fails |
Source code in src/appimage_updater/repositories/gitlab/client.py
should_enable_prerelease(owner, repo, base_url='https://gitlab.com')
async
¶
Check if prerelease should be automatically enabled for a repository.
This method examines recent releases to determine if only prereleases exist. If no stable releases are found in the recent history, it suggests enabling prerelease mode.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
owner
|
str
|
Project owner/namespace |
required |
repo
|
str
|
Repository name |
required |
base_url
|
str
|
GitLab instance base URL |
'https://gitlab.com'
|
Returns:
Type | Description |
---|---|
bool
|
True if only prereleases are found, False if stable releases exist |
Raises:
Type | Description |
---|---|
GitLabClientError
|
If the API request fails |
Source code in src/appimage_updater/repositories/gitlab/client.py
GitLabClientError
¶
Exception raised for GitLab API client errors.