Feature requests - what do you already love, what could be better?

Hey Janosh, thanks for suggesting this. We might consider this for the future! I’ve added a note on the analytics project, and we’ll respond here if there are any updates to share. :slight_smile:

1 Like

Thanks @perry, much appreciated!

1 Like

Would it be possible to have one branch do multiple deploys?

For example: Netlify is linked to a Github repo. All code is merged into the master branch of that repo. The Netlify config for that repo has two different URLs - example.com and either staging.example.com or just use a consistent netlify url for staging.

The deploys to the main site can be locked just like normal, but the deploys to the staging branch are continuous.

Why?

  • All code is merged to master, reducing merge conflicts and reducing the need for a persistent staging branch (which usually then has to get merged into master later on to deploy)
  • The staging branch+website is always the latest code, greatly simplifying QAs’ jobs by not having n number of different netlify deploys to go look at, and devs’ jobs by integrating sooner with other dev’s code
  • Deploys to prod website can be manual (by unlocking the deploy and then locking again)

Thoughts?

[edit] from a very naive perspective, it seems that netlify maybe already has the core functionality to enable this, it would just be rearranging it in a different way. But software is hardly ever that easy :smiley:

But this would be a huge boon to devs/companies that do trunk-based development, which currently with netlify is a pain and a blocker in many ways. We’ve considered moving off of netlify because of the difficulty of trying to get a good trunk-based development workflow going.

Hiya @anthony1,

We try not to judge folks’ workflows; I trust you have a reason for wanting what you want :slight_smile:

You can link as many sites as you like to the same repo, put different names and different configs on them, even if you build the same branch.

I think that will solve your problem without much hassle, but let me know if not!

@fool

We try not to judge folks’ workflows; I trust you have a reason for wanting what you want :slight_smile:

Trunk-based development isn’t some strange idea, it’s quite popular and common. :slight_smile:

https://www.optimizely.com/optimization-glossary/trunk-based-development/

https://cloud.google.com/solutions/devops/devops-tech-trunk-based-development

It’s a workflow that Netlify just doesn’t really support that well, and I’m hoping that my suggested changes make the support a lot better.

I think what trunk-based devs are doing currently is just building elsewhere and then using the Netlify CLI to upload to various sites. Again, not ideal, and it could be so much better if Netlify supported this workflow directly.

You can link as many sites as you like to the same repo, put different names and different configs on them, even if you build the same branch.

Thanks, I’ll try this for the moment. It’s just not ideal to have two different places that I have to manage website config/settings.

An issue I’m running into implementing this workaroud, though, is that the deploy context for both sites is production but that’s not what I want it to be for my staging website. (E.g. we’re using a netlify.toml file with different contexts to determine which API backend to hit. But if both the “staging” website and the “production” website have the production context, they’re both hitting production APIs.)

Is there a way to change the context, or is it always just determined by the main branch? I wasn’t able to find anything concrete in the docs. But I could have missed something?

If not, then I think my next best bet is to just pull deploys out of Netlify and do them somewhere else (e.g. CircleCI) and then upload the built files to separate Netlify websites? (alternatively, I can change those to run-time variables as well)

Trunk-based development isn’t some strange idea, it’s quite popular and common. :slight_smile:

Sure, I wasn’t trying to say it was weird, just that we don’t judge and try to enable you.

On second reading of your initial request, as far as I can tell, what you have asked for is the default:

  • locked deploys prevent production content from changing
  • but have no impact on branch deploys.

Were you seeing something different?

I had initially thought you wanted to lock the staging branch deploy was why I gave you that advice, but I am no longer confident in either read after going over it a few times.

@fool

I’m not sure if we’re on the same page; let me try to explain in a different way what I would like to achieve:

  • I probably wouldn’t use branch deploys - branches are short lived (e.g. hours or a couple days at most) so it probably isn’t worth it
  • All code is merged directly to master branch.
  • Master branch deploys to two (or more? I would probably only use 2 to start, but I have used 3 at various places) different sites:
    • a “stage” website. This website is always deployed/updated when code is merged to master
    • a “prod” website. This website deployment is “locked”, and then can be “unlocked” when we’re ready to “deploy to prod”. We can then lock it again afterwards
  • Both the stage and prod website are managed in a single website config, since really it’s the same repo and even same branch - the only difference is which specific commit has been deployed.

This workflow better matches how trunk-based development generally works, and would improve trunk-based workflows significantly.

Does this help? Let me know if it still doesn’t make sense. Thanks!

I guess I am not understanding what is not possible in that workflow with our existing tooling:

  1. you configure your repo with a netlify.toml that will apply for the 2 sites you link it to. It sets things like environment variables, build command, etc.
  2. on the stage site, you have us build every commit automatically. You can see work in progress at reliable URL’s like feat-1234–mystagesite.netlify.app, and you can see the production build at its URL which you could either set a sitename like “beta.yourdomain.com” for, or use the netlify site directly (https://yourstagingsite.netlify.app).
  3. on the prod site, you have deploys either turned off completely or instead use the locked deploy feature to prevent unwanted publishes. You’d also have builds for all non-production branches turned off, since you don’t need to see a second copy of those builds on the short lived branches on this second site.

Does that sound feasible, and if not, what feels bad about it?

I would love the documentation for Functions to be clearer, especially for those who are new to the concept. There’s a smattering of information on the internet, but it’s hard to tell what is outdated and what doesn’t work. I still don’t know whether to use netlify-build or the build process or what the real difference is. Simple examples would really help - using CRA, using Express, accessing files within a lambda function, etc.

1 Like

@fool

from my earlier post:

so essentially two issues -

  1. not having the ability to change settings for both websites at the same time
  2. the netlify.toml sees both websites as “production” so it’s difficult to have different settings/environment variables since they’re both considered “production”

I think 1) isn’t a big deal, but would be an improvement, but 2) is a big deal and will require me to reconfigure quite a bit to get things to work in this setup. I think it can be done, it’s just not easy nor ideal.

Ah, thanks for clarifying! I don’t have a good workaround for #2 except doing something conditionally in your build script based on site name or site ID, not exactly an easy pattern, since you’d also have to create something for local dev to work. If you only had different branchnames, (staging used a staging branch), you could set branch-specific contexts like [context.master] and [context.staging]. But then we also wouldn’t be talking :slight_smile:

I don’t understand what settings you are making per website, outside of netlify.toml that you need to make in two places - could you elaborate? Perhaps it is possible to set them all there and at least remove the #1 problem.

I don’t understand what settings you are making per website, outside of netlify.toml that you need to make in two places - could you elaborate? Perhaps it is possible to set them all there and at least remove the #1 problem.

Just pretty much anything that is configured through the Netlify website itself, e.g. environment variables, notifications, etc. Nothing major though.

Thanks for walking through this with me. :slight_smile:

environment variables can be configured in netlify.toml (probably only useful if not sensitive; I don’t like committing e.g. my ssh key to the repo!):

https://docs.netlify.com/configure-builds/file-based-configuration/#sample-file shows an example (search for “super secret”).

Glad to talk, sorry we didn’t have a more perfect fit for your workflow!

I am currently using the build ignore feature with a monorepo quite heavily. I also happen to use slack webhooks to notify my team about successful and failed builds.

What I really wish for at this moment, is to differentiate between failed builds and cancelled builds.

I get reports of a failed build in slack every time a build is cancelled, though I see the cancelled tag in netlify itself. I’d love for that to be reflected in the webhook message sent to slack as well.

1 Like

~Request: DNS Zone declared in code repo~

Netlify already has great DNS support, and one makes it very easy to provision SSL certs.
My ask is to augment the Netlify DNS feature to allow us to define our DNS zone records (A, CNAME, ALIAS) as code in our repo. This would allow us to manage our DNS as code.

Hey CRSRDS,

Interesting proposition. May I ask how/why the UI is insufficient for your use case? Not to challenge your request, I’m merely intrigued!

Related to this: I’d love a distinct message type for cancelled builds that can subscribed to, so that we can opt in to notifications for cancelled builds the same way we currently can for successful or failed builds.

Hey @m-schrepel, @lettertwo,

I’ve added both voices to a feature request for this. If/when it’s actioned, we’ll be in touch!

1 Like

I played a bit with asset optimization and security headers/features. I’ve noticed assets optimized are missing subresource integrity. I’d love to have SRI by default on optimized assets.

1 Like

Hey @HyperTesto,

Not the first time we’ve heard this one, either! I’ve added your voice to the open feature request.

1 Like