Skip to main content

Crate ai6_source_github

Crate ai6_source_github 

Source
Expand description

ai6-source-github: the github provider. As a Source it lists the open issues (and pull requests) of one repository that carry the configured labels; as a Tracker it reads, comments on, labels, closes and creates issues of that repository. Requests are blocking; the host calls them off its async runtime.

§ai6-source-github

Version Rust version License: MPL-2.0 Docs CI

The github Source provider for AI6: open GitHub issues that carry a label become Missions, and the outcome comes back as a comment. See the API header.

§Features

  • Polls one repository’s open issues and pull requests by label and assignee, resuming from a cursor so only changed items are fetched.
  • Reads its token from the environment variable the Operation names; the token is never configured or logged.
  • Reports a rate limit as an error and tries again on the next poll; pagination never leaves the configured API origin.
  • As a Tracker, reads, comments on, labels, assigns, closes and creates issues, attaches sub-issues, and lists the replies that may answer a question.
  • Builds as both a Rust library and the Guatiao provider library a Station loads.

§Installation

Part of the AI6 workspace; built with it:

cargo build -p ai6 --features cli -p ai6-source-github

§Quick start

In operations.toml:

[operation.G.sources.github]
repo = "jose-pr/ai6"
labels = ["ai6:ready"]
token_env = "GITHUB_TOKEN"

Then start a Station that holds the Headquarters lease with the library on its plugin path:

GITHUB_TOKEN=... cargo run -p ai6 --features cli -- serve --plugin-path target/debug

§Development

cargo test -p ai6-source-github
cargo clippy -p ai6-source-github --all-targets -- -D warnings

Tests run against a loopback HTTP server that answers with responses recorded from GitHub and scrubbed; they never call GitHub. tests/live.rs is the exception: it runs the provider against a real repository, is ignored by default, and says at its top what it needs.

§License

MPL-2.0. See LICENSE.

Structs§

Github
GitHub issues as an AI6 Source and Tracker.
Settings
One instance’s settings, from [operation.<id>.sources.<name>].

Constants§

PROVIDER_ID
The provider ID an Operation names under sources.

Statics§

guatiao_declares
What this library declares, read by a scanner as data.

Functions§

guatiao_library_entry⚠
The symbol a guatiao host loads this library by.