Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Clarity on the respective purposes of build and publish #1102

Closed
JamesHenry opened this issue Feb 21, 2020 · 10 comments
Closed

Clarity on the respective purposes of build and publish #1102

JamesHenry opened this issue Feb 21, 2020 · 10 comments

Comments

@JamesHenry
Copy link

馃挕 Feature request

Overview and problem statement

I guess this would likely fall into a request for documentation updates...

I just went to set up a CI/CD pipeline for an experimental Cloudflare Worker I am working on and wrangler did not behave how I intuitively expected it to.

I set up a Build stage to my pipeline in which I ran wrangler build, then published the built artifact for consumption in my Deploy stage. Pretty standard stuff I think.

In my Deploy stage I set up wrangler publish and expected it to be responsible for taking the result of wrangler build (a nice lightweight artifact) and publishing it to my Cloudflare account.

Instead it seems like publish essentially needs the full repo source and npm installation all over again, which suggests it is not intended to be combined with build at all, which has left me confused as to the design/intended use-cases of the commands.

Would love to hear your thoughts on this setup and intuition, maybe I have just messed up my approach.

Thanks!

@exvuma
Copy link
Contributor

exvuma commented Mar 2, 2020

I agree it is unclear and frustrating to have to build every time on publish. JS developers often know what steps to get a project built and prefer to have control of that. I think rather than documenting this we should consider solving the problem at the design of the CLI level.

Possible solutions:

  • publish --skip-build. Which would simply publish to CF but do no building. Radical, but if this flag gets popular consider sunsetting the old publish to skip builds by default
  • Inwrangler.toml, have type='javascript' not install wasm-pack or build anything it simply talks to CF's API

@JamesHenry
Copy link
Author

JamesHenry commented Mar 11, 2020

@victoriabernard92 thanks for acknowledging - I can see you work at Cloudflare, do you help run the project? Would you be willing to accept PRs to implement these proposed solutions?

@exvuma exvuma added the design label Mar 11, 2020
@exvuma
Copy link
Contributor

exvuma commented Mar 11, 2020

@JamesHenry while we do accept PRs this proposal needs design from and buy in from our team. I am looking forward to hearing their suggestions and getting back to you.

@JamesHenry
Copy link
Author

@victoriabernard92 Are there individuals we can ping to make this a little more concrete?

Again, I am happy to do all the work here, I just need the go ahead

@ashleymichal ashleymichal added this to the wrangler build milestone Apr 28, 2020
@stale
Copy link

stale bot commented Jun 27, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 27, 2020
@JamesHenry
Copy link
Author

This should remain open please

@stale stale bot removed the wontfix label Jun 27, 2020
@stale
Copy link

stale bot commented Aug 27, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 27, 2020
@JamesHenry
Copy link
Author

This should remain open please.

@ashleymichal - is there a way I can avoid this now being my job to keep this open? 馃槄

This seems to have been acknowledged by the team as something that could be improved and will be addressed?

@stale stale bot removed the wontfix label Sep 1, 2020
@ashleymichal
Copy link
Contributor

it is indeed; it also needs some attention alongside the other wrangler build issues. i think a wrangler publish --skip-build flag could be a good approach to solving the immediate problem; I think it would also benefit from a top-level build_dir setting in wrangler.toml that defaults to the existing build_dir settings.

@xortive
Copy link
Contributor

xortive commented Feb 25, 2021

closing since this is addressed by #1677, which will be going out as part of an RC in the near future.

@xortive xortive closed this as completed Feb 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants