Skip to content

Commit 6e40e09

Browse files
authored
Minor version update | 2.2.0 --> 2.2.1 (#27)
## New in version 2.2.1 - Many more bugfixes, dependency updates - Added contributing standards and pull request templates - Added interfaces and strong typing to all database calls - Updated workflows to work on the correct branches - Refined branch protection rules to make collaboration easier ## Merged Pull Requests * Update README.md by @nathen418 in #14 * Create dependabot.yml by @nathen418 in #15 * Bump chalk from 4.1.2 to 5.0.1 by @dependabot in #18 * Bump mongoose from 6.5.3 to 6.5.4 by @dependabot in #16 * Nathen418/update dependabot by @nathen418 in #19 * merge main into staging by @nathen418 in #20 * update what branches workflows to run on correct branches and triggers by @schiltz3 in #24 * Add Contributing Standards by @nathen418 in #25 * PR template by @schiltz3 in #26 * Add interfaces for models by @schiltz3 in #22 * Fix bug in `addNewRole` by @schiltz3 in #29 * Bugfix/schiltz3/deepsource by @schiltz3 in #28 ## New Contributors * @dependabot made their first contribution in #18 **Full Changelog**: v2.2.0...v2.2.1
2 parents 04e77ce + 718c5f7 commit 6e40e09

31 files changed

+280
-183
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
# Descriptive title
3+
4+
A person with no idea what task you were working on before should at least
5+
have an idea as to what you did.
6+
7+
# Link to github card
8+
Type `#` to see list of autolinks to pull requests or issues
9+
10+
# Changes
11+
The body should contain a high-level overview of the individual changes you made, what parts of the application you changed, etc.
12+
This may be in list form.
13+
14+
15+
*
16+
*
17+
*
18+
19+
20+
You may also wish to include links to related pull requests, issues, or branches which may affect your changes.
21+
You can mention people by using `@`

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ updates:
88
- package-ecosystem: "npm" # See documentation for possible values
99
directory: "/" # Location of package manifests
1010
schedule:
11-
interval: "weekly"
11+
interval: "daily"
1212
target-branch: "staging"

.github/workflows/codeql.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111
#
1212
name: "CodeQL"
1313

14-
on:
15-
push:
16-
branches: [ "main, staging" ]
14+
on:
15+
push:
1716
pull_request:
18-
# The branches below must be a subset of the branches above
19-
branches: [ "main, staging" ]
17+
branches: [ main, staging ]
2018
schedule:
2119
- cron: '19 8 * * 2'
2220

.github/workflows/dependency-review.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
# Source repository: https://github.com/actions/dependency-review-action
66
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
77
name: 'Dependency Review'
8-
on: [pull_request]
8+
on:
9+
pull_request:
10+
branches: [main, staging]
911

1012
permissions:
1113
contents: read

.github/workflows/docker-image.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: Docker Image CI
22

3-
on:
4-
push:
5-
branches: [ "main, staging" ]
3+
on:
4+
push:
65
pull_request:
7-
branches: [ "main, staging" ]
6+
branches: [ main, staging ]
87

98
jobs:
109

.github/workflows/format.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Format
22
on:
33
pull_request:
4+
branches: ['*', '!main']
45
jobs:
56
format:
67
runs-on: ubuntu-latest

.github/workflows/publish-docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Publish Docker image to GitHub Package Registry
22
on:
33
push:
4-
branches: [ "main" ]
4+
branches: [ main ]
55
jobs:
66
build:
77
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**/__pycache__
22
.vscode
3-
.env
3+
*.env
44
node_modules
55
unused-commands
66
d.py/

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# CSSC-bot Contributing guidelines
2+
3+
## Developing New Features
4+
5+
First create a new branch with it's base set to the [staging](https://github.com/Antares-Network/CSSC-Bot/tree/staging) branch.
6+
For naming conventions use `feature/GithubUsername/FeatureName`. Example: `feature/nathen418/mongodb-support`
7+
Next when your feature is ready to be merged, submit a pull request to the [staging](https://github.com/Antares-Network/CSSC-Bot/tree/staging) branch.
8+
This will be used to test your changes along side the rest of the code and any other pending new features.
9+
10+
## Fixing Bugs
11+
12+
Do the same as the instructions except when naming your branch use the naming convention: `bugfix/GithubUsername/BugName`. Example: `bugfix/nathen418/fix-api-connection-err`
13+
14+
## Editing/Merging Pull Requests
15+
16+
Only merge pull requests you authored or have been approved by the author to merge.
17+
18+
## Pushing to branches
19+
20+
Only push to branches you have been given permission to push to. This means that you should only commit to branches that have your name in the branch name unless the branch owner has given you permission to push to it.

commands/owner/createRoles.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { ICommand } from "wokcommands";
22
import { createRoles } from "../../rolesOps";
33
import chalk from "chalk";
4+
import { classModel } from "../../models/classModel";
5+
import { staffModel } from "../../models/staffModel";
6+
import { yearModel } from "../../models/yearModel";
47

58
export default {
69
name: "createRoles",
@@ -13,18 +16,17 @@ export default {
1316
ownerOnly: true,
1417

1518
callback: async ({ interaction }) => {
16-
console.log(
17-
chalk.green(
18-
"Creating roles...\nCopy and paste the following output into your .env file"
19-
)
20-
);
19+
console.log(chalk.green("Creating roles..."));
2120
console.log(
2221
chalk.red("------------------------------------------------------")
2322
);
23+
if (interaction.guild === null) {
24+
return;
25+
}
2426
// Create the roles
25-
createRoles(interaction.guild!, "class");
26-
createRoles(interaction.guild!, "staff");
27-
createRoles(interaction.guild!, "year");
27+
await createRoles(interaction.guild, classModel);
28+
await createRoles(interaction.guild, staffModel);
29+
await createRoles(interaction.guild, yearModel);
2830
interaction.reply({
2931
content: "Roles created!",
3032
ephemeral: true,

0 commit comments

Comments
 (0)