Skip to content

Commit

Permalink
chore: improve pr-time messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Oct 9, 2023
1 parent 2309920 commit afa0a48
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ jobs:
with:
access_token: ${{ github.token }}

update-pull-request-body:
name: Add links to built extensions
build-in-progress-message:
name:
if: github.repository == 'leather-wallet/extension' && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
needs:
- pre-run
steps:
- uses: kyranjamie/[email protected]
with:
header: '> Try out this version of Leather — [download extension builds](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).'
header: '> Build in progress'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build_chrome_extension:
build-chromium:
name: Build debug Chrome extension
runs-on: ubuntu-latest
needs:
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
name: leather-chromium
path: leather-chromium.zip

build_firefox:
build-firefox:
name: Build debug Firefox extension
runs-on: ubuntu-latest
needs:
Expand Down Expand Up @@ -98,3 +98,17 @@ jobs:
with:
name: leather-firefox
path: leather-firefox.zip

add-download-link:
name: Add link to built extensions
if: github.repository == 'leather-wallet/extension' && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
needs:
- pre-run
- build-chromium
- build-firefox
steps:
- uses: kyranjamie/[email protected]
with:
header: '> Try out this version of Leather — [download extension builds](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 0 additions & 4 deletions src/app/components/app-version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { useIsLatestPullRequestBuild } from '@app/query/common/outdated-pr/outda

import { Tooltip } from './tooltip';

// Now I change the code and push so that the PR build is outdated

interface AppVersionLabelProps extends HTMLStyledProps<'span'> {
isLatestVersion: boolean;
}
Expand All @@ -37,8 +35,6 @@ export function AppVersion() {
const { pullRequestLink, isLatestBuild } = useIsLatestPullRequestBuild();

const version = useMemo(() => {
// eslint-disable-next-line no-console
console.log('process.env.WALLET_ENVIRONMENT', process.env.WALLET_ENVIRONMENT);
switch (process.env.WALLET_ENVIRONMENT) {
case 'development':
return `dev@${BRANCH_NAME}`;
Expand Down
3 changes: 0 additions & 3 deletions src/app/query/common/outdated-pr/outdated-pr.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ async function getPullRequestDetails(pr: string): Promise<PrDetailsResp> {
const resp = await axios.get(
`https://api.github.com/repos/${GITHUB_ORG}/${GITHUB_REPO}/pulls/${pr}`
);

return resp.data;
}

Expand All @@ -29,8 +28,6 @@ function usePullRequestDetailsQuery() {
export function useIsLatestPullRequestBuild() {
const { data: pullRequest } = usePullRequestDetailsQuery();
if (!pullRequest) return { isLatestBuild: true };
// eslint-disable-next-line no-console
console.log('debug info', { fromGithubApi: pullRequest.head.sha, fromEnv: COMMIT_SHA });
return {
// If the latest commit SHA on the PR is not the same one used for this build,
// we can assume it's outdated
Expand Down

0 comments on commit afa0a48

Please sign in to comment.