Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy 1.2.0 #328

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5a01d8f
Automatic deployment (#272)
Arif-Khalid Mar 4, 2024
06260a9
Refactor title filter (#265)
Arif-Khalid Mar 4, 2024
518ea79
Fix zone testing import error (#269)
NereusWB922 Mar 4, 2024
00f64fb
Refactor test cases for issue sorter (#270)
NereusWB922 Mar 4, 2024
48b6315
Refactor test cases for user service (#271)
NereusWB922 Mar 4, 2024
8c36423
Refactor test cases for label filter bar component (#274)
NereusWB922 Mar 4, 2024
f435ca1
Update test cases for phase service (#275)
NereusWB922 Mar 8, 2024
5747ceb
Enable pre-push hook for npm test execution (#288)
NereusWB922 Mar 11, 2024
f6a8f23
Refactor milestones to save by name (#289)
Arif-Khalid Mar 12, 2024
7e68bbd
Remove sorting by assignees in Issue Sorter (#286)
MadLamprey Mar 12, 2024
09ca9ab
Create release for v1.1.1 (#279)
vigneshsankariyer1234567890 Mar 14, 2024
1df2c95
Merge branch 'deploy' into main
gycgabriel Mar 14, 2024
a8825f1
Release changelog automation (#285)
Arif-Khalid Mar 18, 2024
8817ca3
Keep filters when switching repos (#281)
Arif-Khalid Mar 20, 2024
663dec3
Refactor Phase Service and remove Phase (#291)
NereusWB922 Mar 20, 2024
6fb348e
Hide redundant column pagination (#309)
nknguyenhc Mar 21, 2024
63ed6a2
Add tool tip for hidden users (#307)
MadLamprey Mar 21, 2024
caadd66
Setup grouping strategy and service (#308)
NereusWB922 Mar 22, 2024
e3d4a34
Three-state labels (#282)
nknguyenhc Mar 22, 2024
a65bb59
Status filter checkboxes (#310)
nknguyenhc Mar 25, 2024
43ea689
Create tests for Error Handling service (#304)
MadLamprey Mar 25, 2024
1fa6138
Create tests for Milestone service (#303)
MadLamprey Mar 25, 2024
3420a73
Integrate Grouping Service (#313)
NereusWB922 Mar 25, 2024
b226977
Keep milestones when switching repo (#311)
Arif-Khalid Mar 27, 2024
cd4614f
Implement group by milestone (#316)
NereusWB922 Mar 29, 2024
0867e1c
Add sorting by Status (#318)
MadLamprey Mar 29, 2024
83dcdae
Include groupby params in url (#319)
NereusWB922 Mar 29, 2024
b1f3eed
Split 'Without a milestone' option (#315)
MadLamprey Mar 29, 2024
c3418d8
Add preset views (#320)
nknguyenhc Mar 29, 2024
8ddcdcd
Reset GroupingContextService only if "keep filter" is selected. (#324)
NereusWB922 Mar 29, 2024
70bae91
Refactor MilestoneGroupingStrategy to match the changes in #315 (#323)
NereusWB922 Mar 29, 2024
2eb2aba
Update repo on back and forward navigation (#322)
NereusWB922 Mar 29, 2024
3ce551e
Fix for no milestone case (#326)
nknguyenhc Mar 30, 2024
3f0aa1f
Enable npm run test in GitHub Action (#325)
NereusWB922 Mar 30, 2024
fa69625
Add filters to url (#314)
Arif-Khalid Mar 30, 2024
c9f59c2
Create release 1.2.0 (#327)
nknguyenhc Mar 30, 2024
6d2d768
Resolve conflicts for 1.2.0 (#329)
nknguyenhc Mar 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: 'Features'
labels:
- 'category.Feature'
- 'category.Enhancement'
- title: 'Bug Fixes'
labels:
- 'category.Bug'
- title: 'Maintenance'
label: 'category.Chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.

template: |
## Changelog

$CHANGES
3 changes: 3 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- run: npm update
- run: npm run lint
- run: npm run build:prod:web
- run: npm run test
# - run: npm test -- "--karma-config=./tests/karma.ci.conf.js"
# - run: npm run webdriver-manager update -- --gecko false --standalone false --versions.chrome $(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$(google-chrome --version | grep -iEo "[0-9]{1,3}" | head -n1))
# - run: npm run webdriver-manager update -- --chrome false --standalone false
Expand All @@ -45,6 +46,7 @@ jobs:
- run: npm install
- run: npm update
- run: npm run lint
- run: npm run test
# - run: npm test -- "--karma-config=./tests/karma.ci.conf.js" || npm test -- "--karma-config=./tests/karma.ci.conf.js"
# retry tests once, in case they timed out on Mac OS
windows-setup-and-tests:
Expand All @@ -61,4 +63,5 @@ jobs:
- run: npm install
- run: npm update
- run: npm run lint
- run: npm run test
# - run: npm test -- "--karma-config=./tests/karma.ci.conf.js"
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "WATcher",
"version": "1.1.0",
"version": "1.2.0",
"main": "main.js",
"scripts": {
"ng": "ng",
Expand All @@ -24,7 +24,7 @@
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged",
"pre-push": "npm run lint"
"pre-push": "npm run lint && npm run test"
}
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import { GithubEventService } from './core/services/githubevent.service';
import { IssueService } from './core/services/issue.service';
import { LabelService } from './core/services/label.service';
import { LoggingService } from './core/services/logging.service';
import { PhaseService } from './core/services/phase.service';
import { RepoSessionStorageService } from './core/services/repo-session-storage.service';
import { UserService } from './core/services/user.service';
import { ViewService } from './core/services/view.service';
import { IssuesViewerModule } from './issues-viewer/issues-viewer.module';
import { LabelDefinitionPopupComponent } from './shared/label-definition-popup/label-definition-popup.component';
import { HeaderComponent } from './shared/layout';
Expand Down Expand Up @@ -64,7 +64,7 @@ import { SharedModule } from './shared/shared.module';
UserService,
IssueService,
LabelService,
PhaseService,
ViewService,
GithubEventService,
Title,
ErrorHandlingService,
Expand All @@ -74,7 +74,7 @@ import { SharedModule } from './shared/shared.module';
{
provide: IssueService,
useFactory: IssueServiceFactory,
deps: [GithubService, UserService, PhaseService]
deps: [GithubService, UserService, ViewService]
},
{
provide: ErrorHandler,
Expand Down
8 changes: 4 additions & 4 deletions src/app/auth/auth.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { AuthService, AuthState } from '../core/services/auth.service';
import { ErrorHandlingService } from '../core/services/error-handling.service';
import { ErrorMessageService } from '../core/services/error-message.service';
import { LoggingService } from '../core/services/logging.service';
import { PhaseService } from '../core/services/phase.service';
import { UserService } from '../core/services/user.service';
import { ViewService } from '../core/services/view.service';

@Component({
selector: 'app-auth',
Expand All @@ -33,7 +33,7 @@ export class AuthComponent implements OnInit, OnDestroy {
private userService: UserService,
private errorHandlingService: ErrorHandlingService,
private router: Router,
private phaseService: PhaseService,
private viewService: ViewService,
private ngZone: NgZone,
private activatedRoute: ActivatedRoute,
private logger: LoggingService
Expand All @@ -46,7 +46,7 @@ export class AuthComponent implements OnInit, OnDestroy {
const state = this.activatedRoute.snapshot.queryParamMap.get('state');

if (this.authService.isAuthenticated()) {
this.router.navigate([this.phaseService.currentPhase]);
this.router.navigate([this.viewService.currentView]);
return;
}
this.initAccessTokenSubscription();
Expand Down Expand Up @@ -141,7 +141,7 @@ export class AuthComponent implements OnInit, OnDestroy {
}

isRepoSet(): boolean {
return this.phaseService.isRepoSet();
return this.viewService.isRepoSet();
}

get currentSessionOrg(): string {
Expand Down
49 changes: 48 additions & 1 deletion src/app/core/models/github-user.model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
export interface GithubUser {
import { Group } from './github/group.interface';

/**
* Represents raw data returned from the GitHub API about a user.
*/
export interface RawGithubUser {
avatar_url: string;
created_at: string;
html_url: string;
Expand All @@ -11,3 +16,45 @@ export interface GithubUser {
updated_at: string;
url: string;
}

/**
* Represents a GitHub user in WATcher
*/
export class GithubUser implements RawGithubUser, Group {
static NO_ASSIGNEE: GithubUser = new GithubUser({
avatar_url: '',
created_at: '',
html_url: '',
login: 'Unassigned',
name: '',
node_id: '',
two_factor_authentication: false,
site_admin: false,
type: '',
updated_at: '',
url: ''
});

avatar_url: string;
created_at: string;
html_url: string;
login: string;
name: string;
node_id: string;
two_factor_authentication: boolean;
site_admin: false;
type: string;
updated_at: string;
url: string;

constructor(rawData: RawGithubUser) {
Object.assign(this, rawData);
}

equals(other: any) {
if (!(other instanceof GithubUser)) {
return false;
}
return this.login === other.login;
}
}
8 changes: 8 additions & 0 deletions src/app/core/models/github/group.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Represents a group used for grouping purposes.
* Groups can be used to organize issues/prs based on certain criteria,
* such as milestones, assignees, or other properties.
*/
export interface Group {
equals(other: any): boolean;
}
9 changes: 6 additions & 3 deletions src/app/core/models/issue.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class Issue {
author: string;
isDraft: boolean;

/** Depending on the phase, assignees attribute can be derived from Github's assignee feature OR from the Github's issue description */
/** Depending on the view, assignees attribute can be derived from Github's assignee feature OR from the Github's issue description */
assignees?: string[];
labels?: string[];
githubLabels?: GithubLabel[];
Expand Down Expand Up @@ -82,8 +82,6 @@ export class Issue {
this.title = githubIssue.title;
this.hiddenDataInDescription = new HiddenData(githubIssue.body);
this.description = Issue.updateDescription(this.hiddenDataInDescription.originalStringWithoutHiddenData);
// githubIssue without milestone will be set to default milestone
this.milestone = githubIssue.milestone ? new Milestone(githubIssue.milestone) : Milestone.DefaultMilestone;
this.state = githubIssue.state;
this.stateReason = githubIssue.stateReason;
this.issueOrPr = githubIssue.issueOrPr;
Expand All @@ -94,6 +92,11 @@ export class Issue {
this.assignees = githubIssue.assignees.map((assignee) => assignee.login);
this.githubLabels = githubIssue.labels;
this.labels = githubIssue.labels.map((label) => label.name);
this.milestone = githubIssue.milestone
? new Milestone(githubIssue.milestone)
: this.issueOrPr === 'Issue'
? Milestone.IssueWithoutMilestone
: Milestone.PRWithoutMilestone;
}

public static createPhaseBugReportingIssue(githubIssue: GithubIssue): Issue {
Expand Down
20 changes: 13 additions & 7 deletions src/app/core/models/milestone.model.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import { Group } from './github/group.interface';

/**
* Represents a milestone and its attributes fetched from Github.
*/
export class Milestone {
static DefaultMilestone: Milestone = new Milestone({ number: 'untracked', title: 'Without a milestone', state: null });
readonly number: string; // equivalent to the id of an issue e.g. milestone #1
export class Milestone implements Group {
static IssueWithoutMilestone: Milestone = new Milestone({ title: 'Issue without a milestone', state: null });
static PRWithoutMilestone: Milestone = new Milestone({ title: 'PR without a milestone', state: null });
title: string;
state: string;
deadline?: Date;

constructor(milestone: { number: string; title: string; state: string }) {
this.number = milestone.number;
constructor(milestone: { title: string; state: string; due_on?: string }) {
this.title = milestone.title;
this.state = milestone.state;
this.deadline = milestone.due_on ? new Date(milestone.due_on) : undefined;
}

public equals(milestone: Milestone) {
return this.number === milestone.number;
public equals(other: any) {
if (!(other instanceof Milestone)) {
return false;
}
return this.title === other.title;
}
}
8 changes: 0 additions & 8 deletions src/app/core/models/phase.model.ts

This file was deleted.

7 changes: 7 additions & 0 deletions src/app/core/models/repo-change-response.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Represents the response of the repo-change-form component
*/
export type RepoChangeResponse = {
repo: string;
keepFilters: boolean;
};
26 changes: 13 additions & 13 deletions src/app/core/models/session.model.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { pipe } from 'rxjs';
import { throwIfFalse } from '../../shared/lib/custom-ops';
import { Phase } from './phase.model';
import { Repo } from './repo.model';
import { View } from './view.model';

/**
* Session repository comprises the phase and its corresponding repository array.
* Session repository comprises the view and its corresponding repository array.
*/
export interface SessionRepo {
phase: Phase;
view: View;
repos: Repo[];
}

Expand All @@ -20,8 +20,8 @@ export interface SessionData {

export const SESSION_DATA_UNAVAILABLE = 'Session data does not exist.';
export const SESSION_DATA_MISSING_FIELDS = 'Session data does not contain any repositories.';
export const NO_VALID_OPEN_PHASES = 'Invalid phases in Session data.';
export const OPENED_PHASE_REPO_UNDEFINED = 'Phase has no repo defined.';
export const NO_VALID_OPEN_VIEWS = 'Invalid views in Session data.';
export const OPENED_VIEW_REPO_UNDEFINED = 'View has no repo defined.';

export function assertSessionDataIntegrity() {
return pipe(
Expand All @@ -30,8 +30,8 @@ export function assertSessionDataIntegrity() {
() => new Error(SESSION_DATA_UNAVAILABLE)
),
throwIfFalse(hasSessionRepo, () => new Error(SESSION_DATA_MISSING_FIELDS)),
throwIfFalse(arePhasesValid, () => new Error(NO_VALID_OPEN_PHASES)),
throwIfFalse(areReposDefined, () => new Error(OPENED_PHASE_REPO_UNDEFINED))
throwIfFalse(areViewsValid, () => new Error(NO_VALID_OPEN_VIEWS)),
throwIfFalse(areReposDefined, () => new Error(OPENED_VIEW_REPO_UNDEFINED))
);
}

Expand All @@ -44,24 +44,24 @@ function hasSessionRepo(sessionData: SessionData): boolean {
}

/**
* Checks if Phases belong to a pre-defined Phase.
* Checks if Views belong to a pre-defined View.
* @param sessionData
*/
function arePhasesValid(sessionData: SessionData): boolean {
function areViewsValid(sessionData: SessionData): boolean {
return sessionData.sessionRepo.reduce(
(isPhaseValidSoFar: boolean, currentPhaseRepo: SessionRepo) => isPhaseValidSoFar && currentPhaseRepo.phase in Phase,
(isViewValidSoFar: boolean, currentViewRepo: SessionRepo) => isViewValidSoFar && currentViewRepo.view in View,
true
);
}

/**
* Checks if each Phase has an associated repo defined as well.
* Checks if each View has an associated repo defined as well.
* @param sessionData
*/
function areReposDefined(sessionData: SessionData): boolean {
return sessionData.sessionRepo.reduce(
(isPhaseRepoDefinedSoFar: boolean, currentPhaseRepo: SessionRepo) =>
isPhaseRepoDefinedSoFar && !!currentPhaseRepo.repos && Array.isArray(currentPhaseRepo.repos) && currentPhaseRepo.repos.length > 0,
(isViewRepoDefinedSoFar: boolean, currentViewRepo: SessionRepo) =>
isViewRepoDefinedSoFar && !!currentViewRepo.repos && Array.isArray(currentViewRepo.repos) && currentViewRepo.repos.length > 0,
true
);
}
4 changes: 4 additions & 0 deletions src/app/core/models/view.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum View {
issuesViewer = 'issuesViewer',
activityDashboard = 'activityDashboard'
}
Loading
Loading