-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: canvaskit now offline #74
Open
jonas-martinez
wants to merge
126
commits into
main
Choose a base branch
from
jonas-martinez/offline-canvas-file
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 94 commits
Commits
Show all changes
126 commits
Select commit
Hold shift + click to select a range
7f9f36e
feat!: Move dev_tools client to this repo (#3)
jonas-martinez a7650bb
ci: Add semantic release docker
jonas-martinez e2729a0
ci: Fix CI for docker hub (#6)
jonas-martinez 25de10d
ci: Set timeout for GitHub Workflow (#4)
shiipou c0a77c1
feat: Dockerfile combine (#9)
jonas-martinez 103a41e
fix: Fixing CI
jonas-martinez 672f47e
fix: Fixing CI
jonas-martinez dd83e86
fix: Fixing CI
jonas-martinez 4268439
fix: Fixing CI
jonas-martinez 123a426
fix: Fixing CI
jonas-martinez 9108cfd
fix: Fixing CI
jonas-martinez e9d2857
fix: Fixing CI
jonas-martinez 49cdf0f
fix: Fixing CI...
jonas-martinez 018b1df
fix: Fixing CI
jonas-martinez 53df028
fix: Fixing CI
jonas-martinez 10eeb3a
fix: Fix docker CI & Dockerfile (#10)
jonas-martinez e14d28d
fix: Fix CI
jonas-martinez 26cae79
fix: Fix server and entrypoint rights (#11)
jonas-martinez 1412c79
docs: Update README.md (#8)
jonas-martinez 62e15e2
fix: Added favicon rel (#13)
jonas-martinez 5939e6b
ci: Fix docker naming (#14)
jonas-martinez b02fc66
ci: Add gitignore baseline, fix semantic release, add server setting …
Nesqwik da781a9
fix: Adapting to new version of application_runner (#16)
jonas-martinez fbf384b
fix: fix CI
6b1156b
fix: update client to beta-5
7d2a08f
feat: Updated client & application_runner deps to latest beta version…
Nesqwik be1d7d8
feat: Updated to Application Runner v 6 (#19)
jonas-martinez d3a0185
feat: Updated deps (#20)
jonas-martinez 9959769
feat: Updated app-runner 8 (#21)
jonas-martinez cef6759
feat: Added device_preview (#23)
jonas-martinez d8a7175
ci: Add automatic PR on lenra's dependancy release (#22)
shiipou 9e23b38
ci: fix github token for sementic release
shiipou ce4aceb
feat: deps-bot: Upgrade client to v1.0.0-beta.8 (#25)
github-actions[bot] d158af2
ci: fix not a git repository on reading commit message
shiipou ecc1276
ci: add better commit message on release
shiipou 6252a38
fix: Fixed image component (#24)
jonas-martinez 6d29384
ci: Build multi-arch docker image
shiipou 2604ed3
ci: add build-args on docker build
shiipou ba5c063
feat: Add lenra favicon & change title (#27)
jonas-martinez 6d57b2a
remove unecessary string strip on docker build
shiipou c7feb8d
ci: Use sementic release for git push
shiipou caac2ae
ci: use build-arg not build-args
shiipou f2e1220
ci: fix missing backslash on docker build
shiipou e59b622
ci: move arch in docker build
shiipou 87269e9
ci: Remove incompatible riscV64
shiipou 93b334d
ci: remove dupliqued docker build
shiipou ec6aa66
feat: Updated dependencies (#29)
jonas-martinez ba427dc
ci: add cache for docker image build
shiipou 3299ece
ci: fix docker build multi-arch
shiipou e870f6c
ci: use build-arg CI
shiipou a48d6c1
ci: take more than 10 minutes to run
shiipou 1bd33a1
ci: Ci take more than 15min to run
shiipou cc885e4
ci: fix empty release type
shiipou 47e7178
ci: fix commit didn't trigger release
shiipou dcb1199
ci: fix docker login wrong image name (#30)
shiipou 13d47d8
ci: allow lenra_ui_runner to update devtools
shiipou 170325d
ci: regroup releases
shiipou 3ab3b51
ci: fix client won't run release
shiipou bc8b484
feat: Update dependencies (#28)
github-actions[bot] 04b34be
fix: Updated flutter for release
jonas-martinez 649c2dc
feat: Update dependencies
jonas-martinez acbb606
ci: more time to build multi-image
shiipou f20fed2
ci: try docker login before build image to fail before using ci time
shiipou a501bf7
ci: fix docker login failed
shiipou 5daeb2e
ci: Add a tag without beta number for generic beta image
shiipou 0c25e57
ci: new docker tag using regex (#34)
shiipou 0a07d91
feat: Update dependencies (#36)
jonas-martinez 94209bb
ci: fix release regex that didn't pass
shiipou 88ee0f0
ci: add "v" before version in docker image release
shiipou b5c0545
ci: revert last commit
shiipou 52c3be6
ci: fix python wrong indent
shiipou ff739d9
ci: fix yq not working anymore after dependency update (#38)
shiipou bae2b4e
feat!: Upgraded devtools to match the Widget system. (#35)
Nesqwik f530639
ci: fix `yq` command not found
shiipou c896fa6
fix: Fixed NotificationListener (#40)
jonas-martinez 3dcf835
fix: Fixed session bug (#43)
jonas-martinez 1df28e8
feat: Update dependencies (#41)
shiipou 7ac7496
fix: Fix ci flutter version (#46)
jonas-martinez 2079c24
fix: Fixed release flutter version (#47)
jonas-martinez 7be83dc
ci: upgrade lenra-io/create-or-update-pr-action
shiipou 6d93d5c
feat: Add error handler (#49)
pichoemr a7ff7b1
feat: Update dependencies (#48)
shiipou 31a6fc0
feat: Update dependencies (#50)
shiipou 6639b2b
fix: Upgrade application_runner to v1.0.0-beta.23 (#53)
shiipou ae6a186
ci: change origin key from `fr_lenra_client` to `client` (#55)
shiipou e19f4b0
feat: Fixed SetupListeners to only call it once (#56)
jonas-martinez 0c8d46c
ci: run `elixir_checks` only if PR is not WIP (#59)
shiipou b706727
ci: update `create-or-update-pr-action` to `v1.1.0` (#60)
shiipou fb534ff
ci: check if push is in PR test (#61)
shiipou 3b42ac1
ci: place timeout on flutter CI (#63)
shiipou b1235cd
ci: add new if condition for lenra_ui_runner (#67)
shiipou ad573b9
feat: Update dependencies (#54)
shiipou e012430
ci: Update flutter (#73)
jonas-martinez 019cb17
feat: canvaskit now offline
jonas-martinez 1ec6e6f
ci: fix pr is wip condition on elixir run
shiipou abf9b4b
ci: fix pr is wip condition on flutter run
shiipou 59227c2
ci: fix pr is wip condition on elixir run
shiipou 43316a6
ci: update action pr-is-wip to v2.0.0
shiipou 92460a5
ci: update action pr-is-wip to v2.0.0
shiipou 2b14f0a
ci: fix ci pr-is-wip
shiipou 89eff50
ci: fix ci pr-is-wip
shiipou 8438699
ci: fix pr-is-wip
shiipou a3128a6
ci: fix pr-is-wip
shiipou 61fca9a
feat: Added fonts to pubspec (#76)
jonas-martinez f37330e
ci: fix prIsWip
shiipou 88f3025
ci: fix prIsWip
shiipou 1fdd137
feat: The watchdog is now handled by the Elixir server (#65)
Nesqwik ae2d12c
feat: Update dependencies (#78)
shiipou 32ef486
feat: Handle ofwatchdog reload (#80)
jonas-martinez b5a361c
ci: More time for release
jonas-martinez 87e14a7
fix: remove PORT env var in template docker image (#101)
shiipou 1b0d44e
ci: Typo in update dependencies (#102)
jonas-martinez 34704a1
feat: Update dependencies (#98)
shiipou f1e1f4b
feat: handle new data system (#105)
pichoemr 70412bc
feat: Update dependencies (#103)
shiipou ed6b7ea
feat: Update dependencies (#108)
shiipou b982f7a
feat: Upgrade client to v1.0.0-beta.64 (#109)
shiipou 6dd1edf
feat: Disable device preview temporarily (#111)
jonas-martinez e31466f
feat: Update dependencies (#110)
shiipou e0acf64
feat: Update dependencies (#112)
shiipou 2ecea2a
feat: Upgrade client to v1.0.0-beta.75 (#114)
shiipou e0d722a
fix: Data API Response (#113)
jonas-martinez 537ca9f
feat: Upgrade client to v1.0.0-beta.76 (#115)
shiipou c123a40
Merge branch 'beta' into jonas-martinez/offline-canvas-file
jonas-martinez 3bc5e6b
Remove canvaskit to use new solution
jonas-martinez a789df6
fix
jonas-martinez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
|
||
set -xe # Show output on the logs | ||
|
||
function get_tag { | ||
version="$1" # Get version tag | ||
DOCKER_IMAGE="$2" | ||
|
||
regex='([0-9]+.[0-9]+.[0-9]+)(-([a-z]+).([0-9]+))?' | ||
|
||
if [[ $version =~ $regex ]]; then | ||
v="${BASH_REMATCH[1]}" | ||
channel="${BASH_REMATCH[3]}" | ||
channel_version="${BASH_REMATCH[4]}" | ||
|
||
tag="--tag ${DOCKER_IMAGE}:${version#v}" | ||
|
||
regex='([0-9]+).([0-9]+).([0-9]+)' | ||
if [[ $v =~ $regex ]]; then | ||
major=${BASH_REMATCH[1]} | ||
minor=${BASH_REMATCH[2]} | ||
patch=${BASH_REMATCH[3]} | ||
|
||
arr_version=( "${major}" "${major}.${minor}" "${major}.${minor}.${patch}" ) | ||
if [[ -n "${channel}" ]]; then | ||
tag="${tag} --tag ${DOCKER_IMAGE}:${channel}" | ||
for i in "${arr_version[@]}"; do | ||
tag="${tag} --tag ${DOCKER_IMAGE}:${i}-${channel}" | ||
done | ||
else | ||
tag="--tag ${DOCKER_IMAGE}:latest" | ||
for i in "${arr_version[@]}"; do | ||
tag="${tag} --tag ${DOCKER_IMAGE}:${i}" | ||
done | ||
fi | ||
return 0 | ||
else | ||
echo "Version '$v' didn't pass Regex '$regex'." 1>&2 | ||
return 1 | ||
fi | ||
else | ||
echo "Version '$version' didn't pass Regex '$regex'." 1>&2 | ||
return 1 | ||
fi | ||
} | ||
|
||
VERSION="$1" # Get version tag | ||
|
||
get_tag "$VERSION" "${DOCKER_IMAGE}" | ||
exit_code=$? | ||
if [[ "$exit_code" != "0" ]]; then | ||
exit $exit_code | ||
fi | ||
|
||
# build the docker image | ||
docker buildx build \ | ||
--output type=image,push=true \ | ||
--platform "amd64,arm64,arm" \ | ||
${tag} \ | ||
--build-arg CI=true \ | ||
--build-arg GH_PERSONNAL_TOKEN="${GITHUB_TOKEN}" \ | ||
--cache-from type=local,src=~/.docker-cache \ | ||
--cache-to type=local,dest=~/.docker-cache \ | ||
. | ||
|
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,60 @@ | ||
name: Create or Update PR | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Lenra Component Version' | ||
required: true | ||
release_notes: | ||
description: 'Lenra Component Release notes' | ||
required: false | ||
origin: | ||
description: 'Label of the dependency to change version.' | ||
required: true | ||
|
||
jobs: | ||
create_or_update_pr: | ||
name: Create or Update PR | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup yq | ||
id: setup-yq | ||
uses: shiipou/setup-yq-action@v2.0.2 | ||
- name: create_pr | ||
uses: lenra-io/create-or-update-pr-action@v1.1.0 | ||
with: | ||
name: 'Update dependecies' | ||
token: ${{ secrets.WORKFLOW_GITHUB_TOKEN }} | ||
script: | | ||
if [[ "${{ github.event.inputs.origin }}" == "client" ]]; then | ||
yq eval ".dependencies.fr_lenra_client.git.ref = \"${{ github.event.inputs.version }}\"" -i client/pubspec.yaml | ||
git add client/pubspec.yaml | ||
elif [[ "${{ github.event.inputs.origin }}" == "lenra_ui_runner" ]]; then | ||
yq eval ".dependencies.lenra_ui_runner.git.ref = \"${{ github.event.inputs.version }}\"" -i client/pubspec.yaml | ||
git add client/pubspec.yaml | ||
else | ||
# Regex in bash is not powerful enough but thanks to python regex that work | ||
## (I choose python because it's already installed on GitHub Action runner) | ||
## This regex parse the private_git element of the server/mix.exs with name is application_runner and replace the tag with the requested version | ||
python3 -c "import re | ||
regex = re.compile(r'private_git\(\s*name\s*:\s*:${{ github.event.inputs.origin }}\s*,(?:\s|(tag:)?(?(1)\s*\"(.*)\"\s*\)|.))*') | ||
with open ('server/mix.exs', 'r') as file : | ||
data = str().join(file.readlines()) | ||
match = re.search(regex, data) | ||
result = data[:match.start(2)] + '${{ github.event.inputs.version }}' + data[match.end(2):] | ||
|
||
with open('server/mix.exs', 'w') as file: | ||
file.writelines(str(result)) | ||
" | ||
git add server/mix.exs | ||
fi | ||
|
||
RELEASE_NOTES="${{ github.event.inputs.release_notes }}" | ||
RELEASE_TYPE="${RELEASE_NOTES/:*}" | ||
|
||
git commit -m "${RELEASE_TYPE}: Upgrade ${{ github.event.inputs.origin }} to ${{ github.event.inputs.version }} | ||
${RELEASE_NOTES}" |
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,57 @@ | ||
name: Flutter CI | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
env: | ||
flutter_version: "2.10.x" | ||
jobs: | ||
prIsWip: | ||
name: PR is WIP? | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 2 | ||
steps: | ||
- id: pr-is-wip | ||
uses: shiipou/pr-is-wip-action@v1.0.0-beta.5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
Setup-Flutter: | ||
needs: | ||
- prIsWip | ||
if: ${{ ! needs.prIsWip.outputs.isWip }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 3 | ||
defaults: | ||
run: | ||
working-directory: ./client | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache Flutter dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: /opt/hostedtoolcache/flutter | ||
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }} | ||
- uses: subosito/flutter-action@v1.5.3 | ||
with: | ||
flutter-version: ${{ env.flutter_version }} | ||
- uses: webfactory/ssh-agent@v0.5.3 | ||
with: | ||
ssh-private-key: | | ||
${{ secrets.LENRA_CLIENT_SSH }} | ||
${{ secrets.LENRA_UI_RUNNER_SSH }} | ||
${{ secrets.LENRA_COMPONENTS_SSH }} | ||
- name: Restore packages | ||
run: flutter pub get | ||
|
||
- name: Analyze | ||
run: flutter analyze --no-congratulate | ||
|
||
- name: Run tests | ||
run: flutter test --coverage | ||
# - name: Upload coverage to codecov | ||
# uses: codecov/codecov-action@v2 | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} |
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,44 @@ | ||
name: Populate Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
populate_release: | ||
name: Populate Release | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- id: extract_tag | ||
env: | ||
GITHUB_REF: ${{ github.ref }} | ||
run: | | ||
echo "Extracting tag..." | ||
REF="${GITHUB_REF##*/}" | ||
echo "output.tag=${REF}" | ||
echo "::set-output name=tag::${REF}" | ||
if [[ ${GITHUB_REF} == *beta.* ]]; then | ||
echo "::set-output name=target_ref::beta" | ||
else | ||
echo "::set-output name=target_ref::main" | ||
fi | ||
|
||
RELEASE_NOTES="$(git log -n1 | head -n5 | tail -n1)" | ||
RELEASE_NOTES="${RELEASE_NOTES/ /}" | ||
echo "::set-output name=release-notes::${RELEASE_NOTES}" | ||
- name: create_pr | ||
uses: shiipou/workflows/trigger_workflow@main | ||
with: | ||
target_ref: ${{ steps.extract_tag.outputs.target_ref }} | ||
target_repository: "${{ github.repository_owner }}/templates" | ||
target_workflow: create_or_update_pr.yml | ||
params: | | ||
{ | ||
"version": "${{ steps.extract_tag.outputs.tag }}", | ||
"origin": "dev-tools", | ||
"release_notes": "${{ steps.extract_tag.outputs.release-notes }}" | ||
} | ||
token: ${{ secrets.WORKFLOW_GITHUB_TOKEN }} |
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,37 +1 @@ | ||
# The directory Mix will write compiled artifacts to. | ||
/_build/ | ||
|
||
# If you run "mix test --cover", coverage assets end up here. | ||
/cover/ | ||
|
||
# The directory Mix downloads your dependencies sources to. | ||
/deps/ | ||
|
||
# Where third-party dependencies like ExDoc output generated docs. | ||
/doc/ | ||
|
||
# Ignore .fetch files in case you like to edit your project deps locally. | ||
/.fetch | ||
|
||
# If the VM crashes, it generates a dump, let's ignore it too. | ||
erl_crash.dump | ||
|
||
# Also ignore archive artifacts (built via "mix archive.build"). | ||
*.ez | ||
|
||
|
||
# Temporary files for e.g. tests | ||
/tmp | ||
|
||
# Ignore package tarball (built via "mix hex.build"). | ||
dev_tool-*.tar | ||
|
||
# Ignore Elixir_ls extension folder | ||
.elixir_ls | ||
|
||
# Since we are building assets from assets/, | ||
# we ignore priv/static. You may want to comment | ||
# this depending on your deployment strategy. | ||
# /priv/static/ | ||
|
||
.env_release | ||
.DS_Store |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locally adding the canvaskit file is probably not a good idea. It force us to maintain the canvaskit on the long run.
Do you know if there is an alternative ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, as explained here flutter/flutter#70101 (comment), there is no alternative in the current state of Flutter. This issue has not been worked on since then and only a cache was implemented (which requires to run the app online first).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank's for the link, Indeed it seems that this workaround is the only way...
I'm not sure the drawback worth the feature. What is your opinion about this @taorepoara ?
Maybe we can add a script before the release that will find the default, FLUTTER_WEB_CANVASKIT_URL download the canvaskit locally, change the --dart-define FLUTTER_WEB_CANVASKIT_URL then bundle the canvasKit with the release.
Or we can keep the current solution but we will have to update manually the canvaskit to get the latest fix/features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note about the UNPKG CDN used :
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment explain how to get the good version of the canvaskit: flutter/flutter#70101 (comment)
Maybe try this two: flutter/flutter#77580 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could work but it first build the app then change the url in the bundled app to use the downloaded canvaskit.
I think we should change the order. First download the canvaskit locally, then use the FLUTTER_WEB_CANVASKIT_URL env variable to build the release with the canvaskit directly.
But since the script take the canvaskit url from the bundled app, i'm not sure this is possible...
If we use the script in flutter/flutter#70101 (comment), we want to make sure that the script (and the CI) fail if the canvaskit cannot be downloaded or the sed cannot replace the URL.
Even with that, the build can be broken if the main.dart.js file change in a future upgrade and lead to an unusable web app.