Skip to main content

deps_gitlab_ci/
lib.rs

1//! GitLab CI/CD ecosystem support for deps-lsp.
2//!
3//! Provides LSP features for `.gitlab-ci.yml` and `.gitlab/ci/*.yml`/`*.yaml` files.
4//!
5//! `include: - project: org/proj` + `ref:` pins are resolved against the GitLab
6//! repository-tags API. `include: - component: host/org/proj/name@ref` pins are resolved
7//! against the GitLab CI/CD Catalog's project-releases API — a component version *is* a
8//! Release, never a raw tag. Self-hosted GitLab instances are supported via
9//! `registries.gitlab_instance_host`.
10//!
11//! # Pin contract
12//!
13//! | Include form | `pin` | Resolved against |
14//! |---|---|---|
15//! | `project: org/proj` + `ref: <40-hex sha>` | [`types::PinStyle::Sha`] | `/repository/tags` |
16//! | `project: org/proj` + `ref: v1.2.3` (exact tag) | [`types::PinStyle::Tag`] | `/repository/tags` |
17//! | `project: org/proj` + `ref: main` (branch) | [`types::PinStyle::Branch`] | not resolved |
18//! | `project: org/proj` (no `ref:`) | `None` | not resolved |
19//! | `component: host/org/proj/name@<40-hex sha>` | [`types::PinStyle::Sha`] | `/releases` |
20//! | `component: host/org/proj/name@1.0` (exact release) | [`types::PinStyle::Tag`] | `/releases` |
21//! | `component: host/org/proj/name@~latest` | [`types::PinStyle::Latest`] | `/releases` |
22//! | `component: host/org/proj/name@1.2` (partial semver) | [`types::PinStyle::Partial`] | `/releases` |
23//! | `component: host/org/proj/name@some-branch` | [`types::PinStyle::Branch`] | not resolved |
24//!
25//! `include: - template: ...` and `include: - remote: ...` are recognized and skipped
26//! (spec FR-003) — not version-pinnable. `image:`/`services:` Docker tags are out of scope
27//! entirely (spec FR-016) and never parsed.
28
29pub mod client;
30pub mod component;
31pub mod ecosystem;
32pub mod formatter;
33pub mod host;
34pub mod parser;
35pub mod registry;
36pub mod types;
37
38pub use ecosystem::GitlabCiEcosystem;
39pub use formatter::GitlabCiFormatter;
40pub use host::{GitlabHost, GitlabInstanceHost, is_valid_gitlab_coordinate};
41pub use parser::parse_gitlab_ci_yaml;
42pub use registry::GitlabCiRegistry;
43pub use types::{
44    EndpointKind, GitlabCiDependency, GitlabCiParseResult, GitlabCiVersion, HostRef, IncludeKind,
45    PinStyle,
46};
47
48/// Stable [`tower_lsp_server::ls_types::Diagnostic::code`] for the FR-012 informational
49/// unresolved-host diagnostic.
50///
51/// Local to this crate rather than a shared `deps-core` diagnostic kind — mirrors
52/// `deps_github_actions::MUTABLE_REF_PIN_DIAGNOSTIC_CODE`'s precedent of a crate-local
53/// stable code for a crate-specific diagnostic.
54pub const UNRESOLVED_HOST_DIAGNOSTIC_CODE: &str = "unresolved-gitlab-host";