Skip to content

Commit

Permalink
misc updates and first doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuchard committed Apr 17, 2024
1 parent 9ad50be commit 315e9c5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
test:
working_directory: /tmp/project
docker:
- image: cimg/rust:1.75.0
- image: cimg/rust:1.77
resource_class: small
steps:
- checkout
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,20 @@ This repository and project is based on the work performed for [MITODL](https://

- `repo`: _required_ The Github repository with the issue tracker in which to read and/or create issues.

- `skip_check`: _optional_

- `number`: _optional_ The issue number to read during the `check` step for triggering Concourse pipelines based on the issue state. If this is omitted then the `check` step is skipped.

The following parameters are for filtering from a list of issues to one issue, and therefore are ignored when an input value is specified for the `number` parameter.

- `state`: _optional_

- `milestone`: _optional_ currently not interfaced between frontend and backend

- `assignee`: _optional_

- `labels`: _optional_

### `version`: designates the Github issue state

**parameters**
Expand Down Expand Up @@ -51,6 +61,8 @@ This ignores any inputs and quickly dummies outputs, and therefore is primarily

The `out` step creates a Github issue according to the input parameters below. The number of the created Github issue is written to a file at `/opt/resource/issue_number.txt` so that it can be re-used later in the build (especially for a subsequent `check` step to trigger based on the status of the Github issue created during this step).

The metadata output from this step contains the number, labels, assignees, and milestone for the issue.

- `title`: _required_ The title of the Github issue.

- `body`: _optional_ The body of the Github issue.
Expand All @@ -61,6 +73,8 @@ The `out` step creates a Github issue according to the input parameters below. T

- `milestone`: _optional_ The milestone number to associate with the issue during creation.

- `state`: _optional_

## Example

```yaml
Expand Down
2 changes: 1 addition & 1 deletion src/github_issue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub(crate) enum Action {
Update,
}

// convert string to IssueState or params::State without trait implementations because not allowed
// convert string to IssueState or params::State without trait implementations because not allowed (no impl Into<octocrab::models::IssueState> for &str)
fn str_to_issue_state(param: &str) -> Result<octocrab::models::IssueState, &str> {
match param {
"Open" => Ok(octocrab::models::IssueState::Open),
Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use concourse_resource::*;
use log;
use env_logger;
use log;

mod concourse;
mod github_issue;
Expand Down Expand Up @@ -34,7 +34,9 @@ impl concourse_resource::Resource for GithubIssue {

// return immediately with two sized vector if check step skip requested (e.g. source for out/put+create)
if source.skip_check() {
log::info!("the check step will be skipped because 'skip_check' was set to true in source");
log::info!(
"the check step will be skipped because 'skip_check' was set to true in source"
);
return vec![
concourse::Version::new(String::from("Open")),
concourse::Version::new(String::from("Closed")),
Expand Down

0 comments on commit 315e9c5

Please sign in to comment.