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

Go embed #2631

Merged
merged 33 commits into from
Oct 20, 2021
Merged

Go embed #2631

merged 33 commits into from
Oct 20, 2021

Conversation

kobergj
Copy link
Collaborator

@kobergj kobergj commented Oct 15, 2021

Description

Use native "embed" package instead 3rd party "filebox"

Related Issue

Motivation and Context

How Has This Been Tested?

Not yet

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs
Copy link

update-docs bot commented Oct 15, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@kobergj
Copy link
Collaborator Author

kobergj commented Oct 15, 2021

rebased version of #1983

@kobergj kobergj mentioned this pull request Oct 15, 2021
12 tasks
@kobergj kobergj self-assigned this Oct 18, 2021
@refs
Copy link
Member

refs commented Oct 18, 2021

Troubleshooting

There were some updates that pull new dependencies. In order to fix them I had to run:

GO111MODULE=off go get -u -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-openapiv2 (notice the -u flag differing from CI)

it might not happen to everyone, but just in case documenting it here.

make -C accounts generate works fine 👍
make -C settings generate fails on my instance with:

yarn install --frozen-lockfile
yarn install v1.22.17
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error fs-extra@10.0.0: The engine "node" is incompatible with this module. Expected version ">=12". Got "10.19.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
make: *** [node_modules] Error 1

make -C graph-explorer generate fails with:

x dist/
x dist/explorer.js.map
x dist/explorer_v1.7.10.js
x dist/explorer.js
x index.html
x node_modules/hellojs/dist/hello.all.js
x src/custom.css
x node_modules/core-js/client/shim.min.js
x node_modules/zone.js/dist/zone.js
x node_modules/systemjs/dist/system.src.js
x node_modules/moment/min/moment-with-locales.min.js

I know it is a work in progress branch, just adding this for future me :)

Changes are 🔝 thanks for taking the time to do this; just seeing the diff image alone makes it worth

@pascalwengerter
Copy link
Contributor

make -C accounts generate works fine +1 make -C settings generate fails on my instance with:

Clarified that this is caused by an older node version on the development machine. Works fine with node v14.17.1 (at least for me 🤓 )

@refs
Copy link
Member

refs commented Oct 18, 2021

make -C accounts generate works fine +1 make -C settings generate fails on my instance with:

Clarified that this is caused by an older node version on the development machine. Works fine with node v14.17.1 (at least for me 🤓 )

What amazes me is that I'm running node 10, shows I haven't done things in node for quite some time. Thanks for pointing it out! updating

@refs
Copy link
Member

refs commented Oct 18, 2021

Tried the changes locally and they work for me. Worth mentioning I had to generate the assets on each package manually as a consequence of removing embed.go files such as https://github.com/owncloud/ocis/blob/master/accounts/pkg/assets/embed.go

The friction-less way of building oCIS for me is make clean build and run, I would suggest adding the generate assets as another build target, not only for CI. How does that sound? Overkill perhaps?

@kobergj
Copy link
Collaborator Author

kobergj commented Oct 19, 2021

@refs Why not just run make clean generate build? We could also move assets creation to build step, but then yarn is a prerequisite to run it.

@refs
Copy link
Member

refs commented Oct 19, 2021

@refs Why not just run make clean generate build? We could also move assets creation to build step, but then yarn is a prerequisite to run it.

because in the layer I work I don't need assets, and before they were embedded in the embed.go file and turned into js with gopherjs, so I spare the overhead :neckbeard:

@kobergj kobergj marked this pull request as ready for review October 19, 2021 14:35
@kobergj kobergj requested review from wkloucek, refs and C0rby and removed request for lookacat, kulmann and pascalwengerter October 19, 2021 14:36
@refs
Copy link
Member

refs commented Oct 19, 2021

@kobergj could add a changelog?

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
6.2% 6.2% Duplication

@kobergj kobergj merged commit d019a00 into owncloud:master Oct 20, 2021
@kobergj kobergj deleted the go-embed branch October 20, 2021 09:31
ownclouders pushed a commit that referenced this pull request Oct 20, 2021
Merge: 839e5c1 5b60841
Author: kobergj <jkoberg@owncloud.com>
Date:   Wed Oct 20 11:31:31 2021 +0200

    Merge pull request #2631 from kobergj/go-embed

    Go embed
@kobergj kobergj mentioned this pull request Oct 21, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants