run prettier formatting
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -37,9 +37,8 @@ export class GitReleaseClient implements GitReleaseApi {
|
||||
}) {
|
||||
this.githubAuthApi = githubAuthApi;
|
||||
|
||||
const gitHubIntegrations = ScmIntegrations.fromConfig(
|
||||
configApi,
|
||||
).github.list();
|
||||
const gitHubIntegrations =
|
||||
ScmIntegrations.fromConfig(configApi).github.list();
|
||||
const { host, apiBaseUrl } = this.getGithubIntegrationConfig({
|
||||
gitHubIntegrations,
|
||||
});
|
||||
@@ -555,15 +554,11 @@ export interface GitReleaseApi {
|
||||
owners: string[];
|
||||
}>;
|
||||
|
||||
getRepositories: (args: {
|
||||
owner: OwnerRepo['owner'];
|
||||
}) => Promise<{
|
||||
getRepositories: (args: { owner: OwnerRepo['owner'] }) => Promise<{
|
||||
repositories: string[];
|
||||
}>;
|
||||
|
||||
getUser: (
|
||||
args: OwnerRepo,
|
||||
) => Promise<{
|
||||
getUser: (args: OwnerRepo) => Promise<{
|
||||
user: {
|
||||
username: string;
|
||||
email?: string;
|
||||
@@ -589,9 +584,7 @@ export interface GitReleaseApi {
|
||||
}[];
|
||||
}>;
|
||||
|
||||
getLatestRelease: (
|
||||
args: OwnerRepo,
|
||||
) => Promise<{
|
||||
getLatestRelease: (args: OwnerRepo) => Promise<{
|
||||
latestRelease: {
|
||||
targetCommitish: string;
|
||||
tagName: string;
|
||||
@@ -602,9 +595,7 @@ export interface GitReleaseApi {
|
||||
} | null;
|
||||
}>;
|
||||
|
||||
getRepository: (
|
||||
args: OwnerRepo,
|
||||
) => Promise<{
|
||||
getRepository: (args: OwnerRepo) => Promise<{
|
||||
repository: {
|
||||
pushPermissions: boolean | undefined;
|
||||
defaultBranch: string;
|
||||
@@ -765,9 +756,7 @@ export interface GitReleaseApi {
|
||||
/**
|
||||
* Get all tags in descending order
|
||||
*/
|
||||
getAllTags: (
|
||||
args: OwnerRepo,
|
||||
) => Promise<{
|
||||
getAllTags: (args: OwnerRepo) => Promise<{
|
||||
tags: Array<{
|
||||
tagName: string;
|
||||
tagSha: string;
|
||||
@@ -775,9 +764,7 @@ export interface GitReleaseApi {
|
||||
}>;
|
||||
}>;
|
||||
|
||||
getAllReleases: (
|
||||
args: OwnerRepo,
|
||||
) => Promise<{
|
||||
getAllReleases: (args: OwnerRepo) => Promise<{
|
||||
releases: Array<{
|
||||
id: number;
|
||||
name: string | null;
|
||||
|
||||
+8
-12
@@ -80,18 +80,14 @@ export const CreateReleaseCandidate = ({
|
||||
);
|
||||
}, [semverBumpLevel, setReleaseCandidateGitInfo, latestRelease, project]);
|
||||
|
||||
const {
|
||||
progress,
|
||||
responseSteps,
|
||||
run,
|
||||
runInvoked,
|
||||
} = useCreateReleaseCandidate({
|
||||
defaultBranch,
|
||||
latestRelease,
|
||||
releaseCandidateGitInfo,
|
||||
project,
|
||||
onSuccess,
|
||||
});
|
||||
const { progress, responseSteps, run, runInvoked } =
|
||||
useCreateReleaseCandidate({
|
||||
defaultBranch,
|
||||
latestRelease,
|
||||
releaseCandidateGitInfo,
|
||||
project,
|
||||
onSuccess,
|
||||
});
|
||||
if (responseSteps.length > 0) {
|
||||
return (
|
||||
<ResponseStepDialog
|
||||
|
||||
+2
-6
@@ -63,12 +63,8 @@ export function useCreateReleaseCandidate({
|
||||
);
|
||||
}
|
||||
|
||||
const {
|
||||
responseSteps,
|
||||
addStepToResponseSteps,
|
||||
asyncCatcher,
|
||||
abortIfError,
|
||||
} = useResponseSteps();
|
||||
const { responseSteps, addStepToResponseSteps, asyncCatcher, abortIfError } =
|
||||
useResponseSteps();
|
||||
|
||||
/**
|
||||
* (1) Get the default branch's most recent commit
|
||||
|
||||
@@ -164,15 +164,16 @@ export const PatchBody = ({
|
||||
{gitDataResponse.value.recentCommitsOnDefaultBranch.map(
|
||||
(commit, index) => {
|
||||
// FIXME: Performance improvement opportunity: Convert to object lookup
|
||||
const commitExistsOnReleaseBranch = !!gitDataResponse.value?.recentCommitsOnReleaseBranch.find(
|
||||
releaseBranchCommit =>
|
||||
releaseBranchCommit.sha === commit.sha ||
|
||||
// The selected patch commit's sha is included in the commit message,
|
||||
// which means it's part of a previous patch
|
||||
releaseBranchCommit.commit.message.includes(
|
||||
getPatchCommitSuffix({ commitSha: commit.sha }),
|
||||
),
|
||||
);
|
||||
const commitExistsOnReleaseBranch =
|
||||
!!gitDataResponse.value?.recentCommitsOnReleaseBranch.find(
|
||||
releaseBranchCommit =>
|
||||
releaseBranchCommit.sha === commit.sha ||
|
||||
// The selected patch commit's sha is included in the commit message,
|
||||
// which means it's part of a previous patch
|
||||
releaseBranchCommit.commit.message.includes(
|
||||
getPatchCommitSuffix({ commitSha: commit.sha }),
|
||||
),
|
||||
);
|
||||
const hasNoParent = !commit.firstParentSha;
|
||||
|
||||
return (
|
||||
|
||||
@@ -54,12 +54,8 @@ export function usePatch({
|
||||
}: UsePatch): CardHook<GetRecentCommitsResultSingle> {
|
||||
const pluginApiClient = useApi(gitReleaseManagerApiRef);
|
||||
const { user } = useUserContext();
|
||||
const {
|
||||
responseSteps,
|
||||
addStepToResponseSteps,
|
||||
asyncCatcher,
|
||||
abortIfError,
|
||||
} = useResponseSteps();
|
||||
const { responseSteps, addStepToResponseSteps, asyncCatcher, abortIfError } =
|
||||
useResponseSteps();
|
||||
|
||||
const releaseBranchName = latestRelease.targetCommitish;
|
||||
|
||||
|
||||
@@ -45,12 +45,8 @@ export function usePromoteRc({
|
||||
const pluginApiClient = useApi(gitReleaseManagerApiRef);
|
||||
const { user } = useUserContext();
|
||||
const { project } = useProjectContext();
|
||||
const {
|
||||
responseSteps,
|
||||
addStepToResponseSteps,
|
||||
asyncCatcher,
|
||||
abortIfError,
|
||||
} = useResponseSteps();
|
||||
const { responseSteps, addStepToResponseSteps, asyncCatcher, abortIfError } =
|
||||
useResponseSteps();
|
||||
|
||||
/**
|
||||
* (1) Fetch most recent release branch commit
|
||||
|
||||
@@ -31,12 +31,8 @@ import { useReleaseStatsContext } from '../../contexts/ReleaseStatsContext';
|
||||
|
||||
export function InDepth() {
|
||||
const { releaseStats } = useReleaseStatsContext();
|
||||
const {
|
||||
averageReleaseTime,
|
||||
progress,
|
||||
releaseCommitPairs,
|
||||
run,
|
||||
} = useGetReleaseTimes();
|
||||
const { averageReleaseTime, progress, releaseCommitPairs, run } =
|
||||
useGetReleaseTimes();
|
||||
|
||||
const skipped =
|
||||
Object.keys(releaseStats.releases).length - releaseCommitPairs.length;
|
||||
|
||||
@@ -80,19 +80,16 @@ export function useGetReleaseTimes() {
|
||||
}, [averageReleaseTime.length, releaseCommitPairs.length]);
|
||||
|
||||
async function getAndSetReleaseTime({ pairIndex }: { pairIndex: number }) {
|
||||
const { baseVersion, startCommit, endCommit } = releaseCommitPairs[
|
||||
pairIndex
|
||||
];
|
||||
const { baseVersion, startCommit, endCommit } =
|
||||
releaseCommitPairs[pairIndex];
|
||||
|
||||
const {
|
||||
startDate: startCommitCreatedAt,
|
||||
endDate: endCommitCreatedAt,
|
||||
} = await getTagDates({
|
||||
pluginApiClient,
|
||||
project,
|
||||
startTag: startCommit,
|
||||
endTag: endCommit,
|
||||
});
|
||||
const { startDate: startCommitCreatedAt, endDate: endCommitCreatedAt } =
|
||||
await getTagDates({
|
||||
pluginApiClient,
|
||||
project,
|
||||
startTag: startCommit,
|
||||
endTag: endCommit,
|
||||
});
|
||||
|
||||
const releaseTime: ReleaseTime = {
|
||||
version: baseVersion,
|
||||
|
||||
@@ -65,21 +65,19 @@ export const getTagDates = async ({
|
||||
}
|
||||
|
||||
if (startTag.tagType === 'tag' && endTag.tagType === 'tag') {
|
||||
const [
|
||||
{ tag: startTagResponse },
|
||||
{ tag: endTagResponse },
|
||||
] = await Promise.all([
|
||||
pluginApiClient.getTag({
|
||||
owner: project.owner,
|
||||
repo: project.repo,
|
||||
tagSha: startTag.tagSha,
|
||||
}),
|
||||
pluginApiClient.getTag({
|
||||
owner: project.owner,
|
||||
repo: project.repo,
|
||||
tagSha: endTag.tagSha,
|
||||
}),
|
||||
]);
|
||||
const [{ tag: startTagResponse }, { tag: endTagResponse }] =
|
||||
await Promise.all([
|
||||
pluginApiClient.getTag({
|
||||
owner: project.owner,
|
||||
repo: project.repo,
|
||||
tagSha: startTag.tagSha,
|
||||
}),
|
||||
pluginApiClient.getTag({
|
||||
owner: project.owner,
|
||||
repo: project.repo,
|
||||
tagSha: endTag.tagSha,
|
||||
}),
|
||||
]);
|
||||
|
||||
return {
|
||||
startDate: startTagResponse.date,
|
||||
|
||||
@@ -22,7 +22,8 @@ export type CalverTagParts = {
|
||||
patch: number;
|
||||
};
|
||||
|
||||
export const calverRegexp = /(rc|version)-([0-9]{4}\.[0-9]{2}\.[0-9]{2})_([0-9]+)/;
|
||||
export const calverRegexp =
|
||||
/(rc|version)-([0-9]{4}\.[0-9]{2}\.[0-9]{2})_([0-9]+)/;
|
||||
|
||||
export function getCalverTagParts(tag: string) {
|
||||
const match = tag.match(calverRegexp);
|
||||
|
||||
@@ -28,9 +28,8 @@ export const useVersioningStrategyMatchesRepoTags = ({
|
||||
latestReleaseTagName?: string;
|
||||
repositoryName?: string;
|
||||
}) => {
|
||||
const [versioningStrategyMatches, setVersioningStrategyMatches] = useState(
|
||||
false,
|
||||
);
|
||||
const [versioningStrategyMatches, setVersioningStrategyMatches] =
|
||||
useState(false);
|
||||
useEffect(() => {
|
||||
setVersioningStrategyMatches(false);
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@ export type UnboxPromise<T extends Promise<any>> = T extends Promise<infer U>
|
||||
? U
|
||||
: never;
|
||||
|
||||
export type UnboxReturnedPromise<
|
||||
T extends (...args: any) => Promise<any>
|
||||
> = UnboxPromise<ReturnType<T>>;
|
||||
export type UnboxReturnedPromise<T extends (...args: any) => Promise<any>> =
|
||||
UnboxPromise<ReturnType<T>>;
|
||||
|
||||
export type UnboxArray<T> = T extends (infer U)[] ? U : T;
|
||||
|
||||
Reference in New Issue
Block a user