MCPcopy Index your code
hub / github.com/1Password/for-open-source / setIssueProperties

Function setIssueProperties

script/testing.go:153–177  ·  view source on GitHub ↗
(application *TestApplicationSet, issue *github.Issue)

Source from the content-addressed store, hash-verified

151}
152
153func setIssueProperties(application *TestApplicationSet, issue *github.Issue) error {
154 issue.Title = &application.issueTitle
155
156 if application.body != "" {
157 issueBodyPath := fmt.Sprintf("./script/mock-issue-bodies/%s.md", application.body)
158 issueBody, err := os.ReadFile(issueBodyPath)
159 if err != nil {
160 return fmt.Errorf("unable to read the file: %v", err)
161 }
162 bodyString := string(issueBody)
163 issue.Body = &bodyString
164 }
165
166 if application.isClosed {
167 state := "closed"
168 issue.State = &state
169 }
170
171 if application.statusLabel != "" {
172 label := fmt.Sprintf("status: %s", application.statusLabel)
173 issue.Labels = append(issue.Labels, &github.Label{Name: &label})
174 }
175
176 return nil
177}
178
179func setTestApplication(testName string) {
180 application, err := findTestApplication(testName)

Callers 1

setTestApplicationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected