This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fb-leap-443/lsf-init
- Loading branch information
Showing
20 changed files
with
206 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,16 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 3 | ||
steps: | ||
- name: Dump the client payload context | ||
env: | ||
PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload) }} | ||
run: echo "$PAYLOAD_CONTEXT" | ||
- uses: hmarr/[email protected] | ||
|
||
- name: Add Workflow link to command comment | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
- name: Checkout on chat command | ||
uses: actions/checkout@v4 | ||
|
@@ -27,28 +33,31 @@ jobs: | |
submodules: 'recursive' | ||
fetch-depth: 0 | ||
|
||
- name: Configure git | ||
shell: bash | ||
run: | | ||
set -xeuo pipefail | ||
git config --global user.name '${{ github.event.client_payload.github.actor }}' | ||
git config --global user.email '${{ github.event.client_payload.github.actor }}@users.noreply.github.com' | ||
- name: Check for merge conflict | ||
id: check-conflict | ||
env: | ||
SLASH_COMMAND_ARG_BRANCH: ${{ github.event.client_payload.slash_command.args.unnamed.arg2 }} | ||
shell: bash | ||
run: | | ||
set -xeuo pipefail | ||
git config --global user.name '${{ github.event.client_payload.github.actor }}' | ||
git config --global user.email '${{ github.event.client_payload.github.actor }}@users.noreply.github.com' | ||
echo "merge_conflict=$(git merge-tree $(git merge-base HEAD origin/$SLASH_COMMAND_ARG_BRANCH) origin/$SLASH_COMMAND_ARG_BRANCH HEAD | grep '<<')" >> $GITHUB_OUTPUT | ||
- name: Add reaction to command comment on merge conflict | ||
uses: peter-evans/create-or-update-comment@v3 | ||
uses: peter-evans/create-or-update-comment@v4 | ||
if: ${{ steps.check-conflict.outputs.merge_conflict }} | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> **Error**: Merge conflict detected, please resolve it using the git command line. | ||
> | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
> **Error**: Merge conflict detected, please resolve it using the command line. | ||
reactions: "-1" | ||
|
||
- name: Merge branch into current branch | ||
|
@@ -72,42 +81,36 @@ jobs: | |
- name: Add reaction to command comment on nothing to do | ||
if: ${{ !steps.check-conflict.outputs.merge_conflict && steps.commit_and_push.outputs.changes == 'no' }} | ||
uses: peter-evans/create-or-update-comment@v3 | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> Already up-to-date. Nothing to commit. | ||
> | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
reactions: "confused" | ||
|
||
- name: Add reaction to command comment on success | ||
if: ${{ !steps.check-conflict.outputs.merge_conflict && steps.commit_and_push.outputs.changes == 'yes' }} | ||
uses: peter-evans/create-or-update-comment@v3 | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> Successfully pushed new changes: | ||
> ${{ steps.commit_and_push.outputs.last_commit_msg }} (${{ steps.commit_and_push.outputs.last_commit_sha }}) | ||
> | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
reactions: "+1" | ||
|
||
- name: Add reaction to command comment on failure | ||
uses: peter-evans/create-or-update-comment@v3 | ||
uses: peter-evans/create-or-update-comment@v4 | ||
if: failure() | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> **Error**: failed to execute "${{ github.event.client_payload.slash_command.args.unnamed.arg1 }}" command | ||
> | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
reactions: "-1" | ||
|
||
help: | ||
|
@@ -116,7 +119,7 @@ jobs: | |
timeout-minutes: 1 | ||
steps: | ||
- name: Update comment | ||
uses: peter-evans/create-or-update-comment@v3 | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: "/git command" | ||
name: "/jira command" | ||
|
||
on: | ||
repository_dispatch: | ||
|
@@ -15,6 +15,15 @@ jobs: | |
steps: | ||
- uses: hmarr/[email protected] | ||
|
||
- name: Add Workflow link to command comment | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
- name: Check user's membership | ||
uses: actions/github-script@v7 | ||
id: check-membership | ||
|
@@ -55,19 +64,17 @@ jobs: | |
type: ${{ github.event.client_payload.slash_command.args.unnamed.arg2 || 'task' }} | ||
|
||
- name: Add reaction to command comment on success | ||
uses: peter-evans/create-or-update-comment@v3 | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> Jira issue [${{ steps.jira-create-issue.outputs.key }}](${{ steps.jira-create-issue.outputs.link }}) is created | ||
> | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
reactions: "+1" | ||
|
||
- name: Add reaction to command comment on failure | ||
uses: peter-evans/create-or-update-comment@v3 | ||
uses: peter-evans/create-or-update-comment@v4 | ||
if: failure() | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
|
@@ -76,7 +83,6 @@ jobs: | |
body: | | ||
> **Error**: failed to execute "${{ github.event.client_payload.slash_command.args.unnamed.arg1 }}" command | ||
> ${{ steps.check-membership.outputs.error }} | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
reactions: "-1" | ||
|
||
help: | ||
|
@@ -85,7 +91,7 @@ jobs: | |
timeout-minutes: 1 | ||
steps: | ||
- name: Update comment | ||
uses: peter-evans/create-or-update-comment@v3 | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,3 +56,6 @@ dist | |
build | ||
build-tmp | ||
.npmrc | ||
|
||
# actions-hub | ||
.github/actions-hub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { getRoot } from "mobx-state-tree"; | ||
import { Fragment } from "react"; | ||
|
||
const ProjectLink = ({ project }) => { | ||
const projectID = project.id; | ||
const onClick = (e) => { | ||
e.stopPropagation(); | ||
|
||
}; | ||
|
||
return ( | ||
<a href={`/projects/${projectID}/data`} onClick={onClick}> | ||
{project.title} | ||
</a> | ||
); | ||
}; | ||
|
||
export const ProjectCell = (cell) => { | ||
const { original, value } = cell; | ||
const root = getRoot(original); | ||
const projectList = value | ||
.map(projectRef => root.taskStore.associatedList.find(proj => proj.id === projectRef.project_id)) | ||
.filter(Boolean); | ||
|
||
return ( | ||
<div | ||
style={{ | ||
maxHeight: "100%", | ||
overflow: "hidden", | ||
fontSize: 12, | ||
lineHeight: "16px", | ||
}} | ||
> | ||
{projectList && ( | ||
projectList | ||
.map((projectRef, index) => ( | ||
<Fragment key={projectRef.project_id}> | ||
{index > 0 && ", "} | ||
<ProjectLink project={projectRef} /> | ||
</Fragment> | ||
)) | ||
)} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
const valueToString = (value) => { | ||
import { format, isValid } from "date-fns"; | ||
import { dateTimeFormat } from "./DateTimeCell"; | ||
|
||
export const valueToString = (value) => { | ||
if (typeof value === "string") return value; | ||
/* if undefined or null we'll treat it as empty string */ | ||
if (value === undefined || value === null) return ""; | ||
if (value instanceof Date && isValid(value)) return format(value, dateTimeFormat); | ||
|
||
try { | ||
/* JSON.stringify will handle JSON and non-strings, non-null, non-undefined */ | ||
return JSON.stringify(value); | ||
} catch { | ||
return value.toString(); | ||
return 'Error: Invalid JSON'; | ||
} | ||
}; | ||
|
||
export const StringCell = ({ value }) => { | ||
const style = { | ||
maxHeight: "100%", | ||
overflow: "hidden", | ||
fontSize: 12, | ||
lineHeight: "16px", | ||
}; | ||
|
||
return ( | ||
<div | ||
style={{ | ||
maxHeight: "100%", | ||
overflow: "hidden", | ||
fontSize: 12, | ||
lineHeight: "16px", | ||
}} | ||
> | ||
{value ? valueToString(value) : ""} | ||
<div style={style}> | ||
{valueToString(value)} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.