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

Signatures: treat dev_block as out-of-date CR 💥 #381

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion frontend/src/pull-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ const formatDate = (dateStr: string | null) => {
return dateStr ? formatter.format(new Date(dateStr)) : null;
};

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function highlightOnChange(
ref: RefObject<HTMLElement>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
dependencies: Array<any>
) {
// Animate a highlight when pull.received_at changes
Expand Down
18 changes: 17 additions & 1 deletion frontend/src/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
StatusState,
CommentSource,
SignatureGroup,
SignatureType,
} from "./types";

export class Pull extends PullData {
Expand All @@ -18,7 +19,8 @@ export class Pull extends PullData {
super();
Object.assign(this, data);

this.cr_signatures = computeSignatures(data.status.allCR);
const syntheticCRs = this.getSyntheticCRSignatures();
this.cr_signatures = computeSignatures(data.status.allCR.concat(syntheticCRs));
this.qa_signatures = computeSignatures(data.status.allQA);
}

Expand Down Expand Up @@ -91,6 +93,20 @@ export class Pull extends PullData {
});
}

getSyntheticCRSignatures(): Signature[] {
// Treat dev_block sigs as out-of-date CRs in that they hold a place
// in the CR requirements.
return this.status.dev_block.map((devBlock) => {
return {
data: {
...devBlock.data,
type: SignatureType.CR,
active: 0,
}
};
});
}

/**
* Returns true if there are required CI statues OR if there are *any* CI
* statuses
Expand Down