Skip to content

Commit 25c2d29

Browse files
authored
[APIPUB-96] - Issue Management Template and Action Workflow (Ed-Fi-Alliance-OSS#97)
* Add copilot actions and instructions * Add actions to the CodeQL * Add dummy change to run the actions
1 parent 4cd13d0 commit 25c2d29

5 files changed

Lines changed: 163 additions & 1 deletion

File tree

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Licensed to the Ed-Fi Alliance under one or more agreements.
3+
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
4+
# See the LICENSE and NOTICES files in the project root for more information.
5+
6+
blank_issues_enabled: false
7+
contact_links:
8+
- name: 🏠 Ed-Fi Community Hub
9+
url: https://community.ed-fi.org
10+
about: For technical support, questions, and community discussions
11+
- name: 📚 Ed-Fi Documentation
12+
url: https://docs.ed-fi.org
13+
about: Official Ed-Fi technical documentation and guides
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Licensed to the Ed-Fi Alliance under one or more agreements.
3+
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
4+
# See the LICENSE and NOTICES files in the project root for more information.
5+
6+
name: "🔧 Engineering Team Issue"
7+
description: "Internal issue for Ed-Fi engineering team members only"
8+
title: "Feature: [Brief Description of the Issue]"
9+
labels: []
10+
assignees: []
11+
body:
12+
- type: markdown
13+
attributes:
14+
value: |
15+
## ⚠️ Engineering Team Only
16+
17+
This template is for Ed-Fi engineering team members only.
18+
19+
If you're not part of the engineering team, please use the [Ed-Fi Community Hub](https://community.ed-fi.org) for support.
20+
21+
- type: textarea
22+
id: description
23+
attributes:
24+
label: "Issue Description"
25+
description: "Describe the issue or task"
26+
placeholder: "Clear description of the issue..."
27+
validations:
28+
required: true
29+
30+
- type: textarea
31+
id: acceptance-criteria
32+
attributes:
33+
label: "Acceptance Criteria"
34+
description: "What needs to be done to resolve this issue?"
35+
placeholder: "- [ ] Criteria 1\n- [ ] Criteria 2"
36+
validations:
37+
required: false
38+
39+
- type: textarea
40+
id: additional-context
41+
attributes:
42+
label: "Additional Context"
43+
description: "Any additional information, screenshots, or context"
44+
placeholder: "Additional details..."
45+
validations:
46+
required: false

.github/copilot-instructions.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## General
2+
3+
* Make only high confidence suggestions when reviewing code changes.
4+
* Never change package.json or package-lock.json files unless explicitly asked to.
5+
* Never change NuGet.config files unless explicitly asked to.
6+
7+
## Formatting
8+
9+
* Apply code-formatting style defined in `.editorconfig`.
10+
* Prefer file-scoped namespace declarations and single-line using directives.
11+
* Insert a newline before the opening curly brace of any code block (e.g., after `if`, `for`, `while`, `foreach`, `using`, `try`, etc.).
12+
* Ensure that the final return statement of a method is on its own line.
13+
* Use pattern matching and switch expressions wherever possible.
14+
* Use `nameof` instead of string literals when referring to member names.
15+
16+
### Nullable Reference Types
17+
18+
* Declare variables non-nullable, and check for `null` at entry points.
19+
* Always use `is null` or `is not null` instead of `== null` or `!= null`.
20+
* Trust the C# null annotations and don't add null checks when the type system says a value cannot be null.
21+
22+
### Testing
23+
24+
* We use NUnit tests.
25+
* We use Shouldly for assertions.
26+
* Use Moq for mocking in tests.
27+
* Copy existing style in nearby files for test method names and capitalization.
28+
29+
## Running tests
30+
31+
* To build and run tests in the repo, use the command `./build.ps1 UnitTest`
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Licensed to the Ed-Fi Alliance under one or more agreements.
3+
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
4+
# See the LICENSE and NOTICES files in the project root for more information.
5+
6+
name: "Issue Management"
7+
8+
on:
9+
issues:
10+
types: [opened]
11+
12+
permissions:
13+
issues: write
14+
15+
jobs:
16+
manage-community-issues:
17+
runs-on: ubuntu-latest
18+
if: github.event.issue.user.type != 'Bot'
19+
steps:
20+
- name: Check if user has repository access
21+
id: check-repo-access
22+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
23+
with:
24+
script: |
25+
try {
26+
// Check if user has repository access (collaborator, maintainer, admin, etc.)
27+
const { data: permission } = await github.rest.repos.getCollaboratorPermissionLevel({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
username: context.payload.issue.user.login
31+
});
32+
33+
console.log(`User ${context.payload.issue.user.login} repository permission: ${permission.permission}`);
34+
return ['admin', 'maintain', 'write', 'triage'].includes(permission.permission);
35+
} catch (error) {
36+
console.log(`User ${context.payload.issue.user.login} does not have repository access: ${error.message}`);
37+
return false;
38+
}
39+
40+
- name: Close community issue with helpful message
41+
if: steps.check-repo-access.outputs.result == 'false'
42+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
43+
with:
44+
script: |
45+
const message = `Thank you for your interest in Ed-Fi!
46+
47+
This GitHub repository is maintained by the Ed-Fi engineering team for internal issue tracking and development coordination.
48+
49+
For technical support, questions, and community discussions, please visit the **[Ed-Fi Community Hub](https://community.ed-fi.org)** where our community and support team can better assist you.
50+
51+
The Ed-Fi Community Hub provides:
52+
- Technical support and troubleshooting
53+
- Community discussions and best practices
54+
- Documentation and resources
55+
- Direct access to Ed-Fi experts
56+
57+
We appreciate your understanding and look forward to helping you on the Community Hub!`;
58+
59+
await github.rest.issues.createComment({
60+
issue_number: context.issue.number,
61+
owner: context.repo.owner,
62+
repo: context.repo.repo,
63+
body: message
64+
});
65+
66+
await github.rest.issues.update({
67+
issue_number: context.issue.number,
68+
owner: context.repo.owner,
69+
repo: context.repo.repo,
70+
state: 'closed',
71+
state_reason: 'not_planned'
72+
});

.github/workflows/on-pullrequest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
if: success()
6161
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # codeql-bundle-v3.28.0
6262
with:
63-
languages: csharp
63+
languages: csharp, actions
6464

6565
- name: Rebuild for CodeQL
6666
run: ./build.ps1 -Command Build -Configuration Debug

0 commit comments

Comments
 (0)