Skip to main content

torii_lib/platforms/bitbucket/
release.rs

1//! Bitbucket Cloud — release client.
2
3use crate::error::{Result, ToriiError};
4use crate::platforms::release::*;
5
6pub struct BitbucketReleaseClient;
7
8impl BitbucketReleaseClient {
9    pub fn new() -> Result<Self> {
10        Ok(Self)
11    }
12}
13
14fn bitbucket_release_unsupported() -> ToriiError {
15    ToriiError::Unsupported(
16        "Bitbucket Cloud has no Release-page object. It exposes \
17         'Downloads' (a flat file list, separate from tags, no notes) \
18         which isn't equivalent. Use annotated tags + the Downloads tab \
19         manually, or mirror to GitHub/GitLab/Codeberg for hosted releases."
20            .to_string(),
21    )
22}
23
24impl ReleaseClient for BitbucketReleaseClient {
25    fn list(&self, _o: &str, _r: &str, _l: usize) -> Result<Vec<Release>> {
26        Err(bitbucket_release_unsupported())
27    }
28    fn get(&self, _o: &str, _r: &str, _t: &str) -> Result<Release> {
29        Err(bitbucket_release_unsupported())
30    }
31    fn edit(&self, _o: &str, _r: &str, _t: &str, _n: Option<&str>, _d: Option<&str>) -> Result<()> {
32        Err(bitbucket_release_unsupported())
33    }
34    fn delete(&self, _o: &str, _r: &str, _t: &str) -> Result<()> {
35        Err(bitbucket_release_unsupported())
36    }
37}
38
39// ============================================================================
40// Factory
41// ============================================================================
42
43// ============================================================================
44// Azure DevOps Releases (classic Release Management — vsrm.dev.azure.com)
45// ============================================================================
46//
47// Azure DevOps has two ways to release: the modern "Pipelines"
48// YAML-defined stages (lives at dev.azure.com under Builds API) and
49// the classic "Releases" service (lives at *vsrm.dev.azure.com*). The
50// classic Releases service is what every legacy project uses; the new
51// YAML stages live under the Pipelines API and aren't 1:1 with our
52// Release abstraction. We wire the *classic* surface — list / get /
53// delete only, edit isn't really a thing on releases (you edit the
54// definition).
55//
56// Tag identifier: torii's `Release.tag` slot stores the release name
57// (e.g. "Release-42"); the numeric id goes in `id` for the
58// edit/delete paths.