Closed cqvu closed 3 years ago
Repository Model
_id
- Repository ID
"owner/repo"
"MLH-Fellowship/CodeOfDuty"
repo_url
- Link to the repo page on the app
"https://codeofduty.com/owner/repo"
maintainers
- Maintainers for a repo
github-usernames
["cqvu", "ajwad-shaikh", "vrusti-mody"]
past_sprints
- Tracked Past Sprints for a repo
[
{
"sprint_object": "542c2b97bac0595474108b48", // Sprint Object Id
"sprint_name": "Sprint 5 | v1.2.2", // Name of the Sprint
"sprint_url": "https://codeofduty.com/owner/repo/10", // Sprint permanent URL
}
]
active_sprints
- Tracks Active Sprints for a repo
[
{
"sprint_object": "542c2b97bac0595474108b48", // Sprint Object Id
"sprint_name": "Sprint 5 | v1.2.2", // Name of the Sprint
"sprint_url": "https://codeofduty.com/owner/repo/10", // Sprint permanent URL
}
]
contributors
- Contributors Leaderboard in the repo
[
{
"user": "cqvu", // github username,
"points_claimed": 20, // contributor points claimed all-time
},
{
"user": "ajwad-shaikh",
"points_claimed": 10,
}
]
Sprints Model
_id
- Unique Object Id for Sprint
ObjectId("542c2b97bac0595474108b48")
repo
- Repository Id (key in repositories collection)
"MLH-Fellowship/CodeOfDuty"
name
- Name of the Sprint (GitHub Milestone)
"Sprint 5 | v1.2.2"
sprint_url
- Link to the Sprint Page on the app
"https://codeofduty.com/owner/repo/10"
milestone_url
- Link to the GitHub Milestone that the Sprint Tracks
"https://github.com/MLH-Fellowship/CodeOfDuty/milestone/1"
contributors
- Contributors participating in the Sprint
[
{
"user": "cqvu", // github username,
"points_claimed": 20, // contributor points claimed for the sprint
"points_at_stake": 50 // contributor points at stake (for assigned & open issues)
},
{
"user": "ajwad-shaikh",
"points_claimed": 10,
"points_at_stake": 40
}
]
tasks
- Tasks taken up in the Sprint
[
{
"issue_url": "https://github.com/MLH-Fellowship/CodeOfDuty/issues/1", // link to the issue on GitHub
"pr_url": "https://github.com/MLH-Fellowship/CodeOfDuty/pull/4", // link to the PR that closes the issue on GitHub
"task_status": "under-review", // one of ['unassigned', 'assigned', 'under-review', 'completed']
"contributor": "ajwad-shaikh", // contributor assigned
"reviewer": "vrusti-mody", // reviewer assigned
"task_points": "50", // total points at stake on the task
"contributor_points": "40",
"reviewer_points": "10"
}
]
open to suggestions @cqvu @vrushti-mody
@ajwad-shaikh Schema structure looks good. Could you make the mongoose schema definition files in the pull request as well?
@cqvu made some changes to the Schema, I think this is a better representation
const sprintOverviewSchema = new mongoose.Schema({
sprint_object: String,
sprint_name: String,
sprint_url: String,
});
const repoLevelContributorSchema = new mongoose.Schema({
user: String,
points_claimed: Number,
});
const sprintLevelContributorSchema = new mongoose.Schema({
user: String,
points_claimed: Number,
points_at_stake: Number,
});
const taskSchema = new mongoose.Schema({
issue_url: String,
pr_url: String,
task_status: String,
contributor: String,
reviewer: String,
contributor_points: Number,
reviewer_points: Number,
});
const repoSchema = new mongoose.Schema({
_id: String,
repo_url: String,
maintainers: [String],
past_sprints: [sprintOverviewSchema],
active_sprints: [sprintOverviewSchema],
contributors: [repoLevelContributorSchema],
});
const sprintSchema = new mongoose.Schema({
repo: String,
name: String,
sprint_url: String,
milestone_url: String,
contributors: [sprintLevelContributorSchema],
tasks: [taskSchema],
boss_hp: Number,
boss_hp_max: Number,
victory_threshold: Number,
});
If possible, discuss the potential schema in the comment thread before implementation