Skip to main content

Crate monochange_hosting

Crate monochange_hosting 

Source
Expand description

§monochange_hosting

monochange_hosting packages the shared git and HTTP plumbing used by hosted source providers.

Reach for this crate when you are implementing GitHub, Gitea, Forgejo, or GitLab release adapters and want one place for release-body rendering, change-request branch naming, JSON requests, and git branch orchestration.

§Why use it?

  • keep provider adapters focused on provider-specific payloads instead of repeated plumbing
  • share one markdown rendering path for release bodies and release pull requests
  • reuse one set of blocking HTTP helpers with consistent error messages

§Best for

  • implementing or testing hosted source adapters
  • generating release pull request bodies from prepared manifests
  • staging, committing, and pushing release branches through shared wrappers

§Public entry points

  • release_body(source, manifest, target) resolves the outward release body for a target
  • release_pull_request_body(manifest) renders the provider change-request body
  • release_pull_request_branch(prefix, command) normalizes the change-request branch name
  • get_json, post_json, patch_json, and put_json wrap provider API requests
  • git_checkout_branch, git_stage_paths, git_commit_paths, and git_push_branch wrap shared git operations

Functions§

build_http_client
Build a blocking HTTP client for provider API calls.
get_json
Perform a GET request and deserialize a successful JSON response.
get_optional_json
Perform a GET request that treats 404 as Ok(None).
git_checkout_branch
Check out or reset the local release branch used for provider requests.
git_commit_paths
Commit the prepared release changes, tolerating a no-op commit.
git_push_branch
Push the release branch to origin with --force-with-lease.
git_stage_paths
Stage the provided paths before creating a release commit.
minimal_release_body
Render a fallback release body when no changelog body is available.
patch_json
Perform a PATCH request and deserialize a successful JSON response.
post_json
Perform a POST request and deserialize a successful JSON response.
push_body_entries
Append release-note entries to a markdown body, normalizing bullet formatting.
put_json
Perform a PUT request and deserialize a successful JSON response.
release_body
Resolve the provider release body for one outward release target.
release_pull_request_body
Render the markdown body used for provider release requests.
release_pull_request_branch
Build the provider change-request branch for a release command.