Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.
ctps: wtf are these js devs doing with environment variables? wtf is this poo poo? Instead of pulling these values from, ya know, the ENVIRONMENT there's whole layers of plugins at every level of the js/npm/webpack shitshow to handle putting that poo poo on the filesystem and reading them into your react app or whatever. I want to set up all the environment vars in docker-compose and in our CI/CD system but it's not working because poo poo's loving hard-coded in a .env or config file or something. I wanna beat the frontend guy with a trout but I know it's not really his fault this is just js dev.

edit: hahahahaa this is the saddest stupidest thing I've read about js

https://www.npmjs.com/package/dotenv

quote:

Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env. Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology.

Oh wow guys we'll just hard-code these values in a different file and we'll be 12-factor!!! A file is just part of the environment, after all, like birds and trees and beers or whatever.

Finster Dexter fucked around with this message at 21:00 on Aug 2, 2018

Adbot
ADBOT LOVES YOU

Mao Zedong Thot
Oct 16, 2008


i think you're supposed to use .env for defaults and dev, and then use actual environment variables non locally

fundamentally that's not horrible, idk what your people are doin

direnv is better tho

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Mao Zedong Thot posted:

i think you're supposed to use .env for defaults and dev, and then use actual environment variables non locally

fundamentally that's not horrible, idk what your people are doin

direnv is better tho

The current frontend guy's readme says: Put necessary env vars in the appropriate `.env.*` file. Any local variables you don't want committed go in `.env.local`

These .env are absolutely intended to go to source control and be used for prod builds. But near as I can tell from the source code, everything is wired up with dotenv, so setting environment variables on my local env or even in a docker container are just flat ignored and it complains about not having a .env value for that variable. This seems so awful. And I've read 6 articles about webpack now that all say that is how you should do it: "gently caress env, put everything in .env files or pass them as arguments to your webpack calls in package.json"

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.
most javascript utilities are written by javascript developers and consequently they are laughably bad. (mlmp)

Shaggar
Apr 26, 2006
vs2017 wanted me to install node externally to build a js client project so I just decided not to do that.

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.

Shaggar posted:

vs2017 wanted me to install node externally to build a js client project so I just decided not to do that.

good decision

redleader
Aug 18, 2005

Engage according to operational parameters

cinci zoo sniper posted:

it worked the other way around and now everyone’s attention is squarely on them, since they themselves admitted the bullshit trivial to verify

well, it would have been a smart play if they didn't gently caress it up!

my homie dhall
Dec 9, 2010

honey, oh please, it's just a machine
storing environment-specific configuration in the artifact is not a fuckup committed solely by js devs, unfortunately

ask me about:
1) having to do an emergency hotfix in code to update a database endpoint
2) repackaging jars at runtime with environment specific property files

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
our gateway/routing config is compiled directly into artifact which is just great and has never caused problems

redleader
Aug 18, 2005

Engage according to operational parameters
all config management sucks. there are no solutions

Mao Zedong Thot
Oct 16, 2008


redleader posted:

all config management sucks. there are no solutions

Bloody
Mar 3, 2013

http://mikehadlow.blogspot.com/2012/05/configuration-complexity-clock.html

necrotic
Aug 2, 2005
I owe my brother big time for this!

Finster Dexter posted:

The current frontend guy's readme says: Put necessary env vars in the appropriate `.env.*` file. Any local variables you don't want committed go in `.env.local`

These .env are absolutely intended to go to source control and be used for prod builds. But near as I can tell from the source code, everything is wired up with dotenv, so setting environment variables on my local env or even in a docker container are just flat ignored and it complains about not having a .env value for that variable. This seems so awful. And I've read 6 articles about webpack now that all say that is how you should do it: "gently caress env, put everything in .env files or pass them as arguments to your webpack calls in package.json"

your dev is an idiot. the first faq entry on dotenv package:

quote:

Should I commit my .env file?

No. We strongly recommend against committing your .env file to version control.

necrotic
Aug 2, 2005
I owe my brother big time for this!
we use dotenv and it works fine if you set a variable in the environment, it supersedes the one in .env.

as is documented in the package.

fire your dev

necrotic
Aug 2, 2005
I owe my brother big time for this!
into the sun (along with javscsript)

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
we wrote a property management system that works really well and is a really great concept but is garbage cans full of burning trash under the hood

still proud of it tho

Workaday Wizard
Oct 23, 2009

by Pragmatica

Blinkz0rz posted:

we wrote a property management system that works really well and is a really great concept but is garbage cans full of burning trash under the hood

still proud of it tho

out of sight out of mind

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
it's the linchpin of services we spend $18m/year running on aws and it's literally loving nodejs but it works flawlessly

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


I was kind of amazed to hear that most of our teams were manually janitoring config or doing 'oh poo poo make sure you copy the right file to prod' type stuff because all our stuff used nice neat config files that had a section per environment and a host-env mapping so your app would always read the right properties. turns out that's all off the back of an internal dll some dude wrote in 2004 that we've built off ever since, I just thought it was normal because it was all I'd ever seen :shrug:

latest versions will pull config details from a remote service that authenticates the host and calling process so you don't have any details in plaintext config and can't accidentally connect non prod to prod.

it owns tbh

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Powerful Two-Hander posted:

I was kind of amazed to hear that most of our teams were manually janitoring config or doing 'oh poo poo make sure you copy the right file to prod' type stuff because all our stuff used nice neat config files that had a section per environment and a host-env mapping so your app would always read the right properties. turns out that's all off the back of an internal dll some dude wrote in 2004 that we've built off ever since, I just thought it was normal because it was all I'd ever seen :shrug:

latest versions will pull config details from a remote service that authenticates the host and calling process so you don't have any details in plaintext config and can't accidentally connect non prod to prod.

it owns tbh

Yeah that poo poo owns, I only got to see that actually work correctly while I was at Amazon. It went to so far as to define which other services could call your teams services, and let you go down to the granularity of each HTTP verb and it's endpoint.

Sapozhnik
Jan 2, 2005

Nap Ghost

a good article

quote:

What we need is a business rules engine

quote:

Initially there was hope that non-technical business users would be able to use the GUI to configure the application

this is the programming equivalent of original sin

Chopstick Dystopia
Jun 16, 2010


lowest high and highest low loser of: WEED WEE
k
Yeah that's a good read thanks Bloody

cinci zoo sniper
Mar 15, 2013




this protocol buffer thing looks interesting. any major problems with it?

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

cinci zoo sniper posted:

this protocol buffer thing looks interesting. any major problems with it?

People do dumb things with default values, also try to use them for more than just on the wire messages

redleader
Aug 18, 2005

Engage according to operational parameters
it robs you of the chance to roll your own serialization format + library. despite what some might say, this is a negative

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
Basically it's good for what it's designed for, just be really firm with idiots wanting to get creative with use cases.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
it's really tempting to want to use them for stuff like immutable value types, especially if they happen to match your wire types anyway. (what, are you going to write them once as a proto, a second time as an AutoValue, plus write converters?)

but you'll inevitably run into an immutable value type that can't be a proto, and now you have two totally incompatible ways of doing immutable value types in your codebase. not sure what the best solution is tbh

cinci zoo sniper
Mar 15, 2013




jit bull transpile posted:

People do dumb things with default values, also try to use them for more than just on the wire messages

so would serialising it to file be a good or dumb choice, as a document store? your answer provides me with a suspicion that it’s mean for internal message transfer strictly

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

cinci zoo sniper posted:

so would serialising it to file be a good or dumb choice, as a document store? your answer provides me with a suspicion that it’s mean for internal message transfer strictly

Let me just say that I have seen attempts to store databases of protobufs and they were painful to use.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Sapozhnik posted:

a good article



this is the programming equivalent of original sin

extremely true

see also "we'll just write our own document storage system, it's easy" and anything involving goddamn workflows

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER


Powerful Two-Hander posted:

extremely true

see also "we'll just write our own document storage system, it's easy" and anything involving goddamn workflows

about this:

what is a good system for version control and storage of documents?

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Storing serialised protobufs is just fine.

What you'll want to be careful with is if you want to actually query your data (e.g. "look up all the things where foo = 12") - at that point you want a database, not just a bunch of files.

e: talking to cinci

cinci zoo sniper
Mar 15, 2013




Boiled Water posted:

about this:

what is a good system for version control and storage of documents?

xml i feel, you can version files and their schemes nicely

e: brainfarted about format, not system. system is a good question.

cinci zoo sniper fucked around with this message at 09:09 on Aug 3, 2018

cinci zoo sniper
Mar 15, 2013




jit bull transpile posted:

Let me just say that I have seen attempts to store databases of protobufs and they were painful to use.

Jabor posted:

Storing serialised protobufs is just fine.

What you'll want to be careful with is if you want to actually query your data (e.g. "look up all the things where foo = 12") - at that point you want a database, not just a bunch of files.

e: talking to cinci

hm, makes sense

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER


cinci zoo sniper posted:

xml i feel, you can version files and their schemes nicely

e: brainfarted about format, not system. system is a good question.

no like marketing has a bunch of word and pdf files in different version how do you keep track of them in a way that's not terrible?

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
make them write in LaTeX and use git?

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER


eschaton posted:

make them write in LaTeX and use git?

lol

cinci zoo sniper
Mar 15, 2013




Boiled Water posted:

no like marketing has a bunch of word and pdf files in different version how do you keep track of them in a way that's not terrible?

please see the thread title

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Boiled Water posted:

about this:

what is a good system for version control and storage of documents?

they're all bad tbh but if ones I've used in descending order of badness:

* something involving blobs in mongo (lol)
* sharepoint (arguably worse than blobs in mongo because users can and will gently caress everything up whilst thinking its great and then make you fix it)
* file share where everyone has root <--technically the worst but OK if you can avoid any responsibility for what happens when someone deletes the entire store
* documentum used directly via its godawful interface
* file share with granular permissions
* documentum buffered via applications that use webservices to do presentation

edit: file shares don't do versions obviously, but if that's all you've got you'll just have people up loading final_copy.1.final.this.one.docx to it anyway and even if they had versioning they probably would use it and would carry on naming everything like that because they're dumb and don't want to change the way they work.

at like any point doing anything with documents someone will say "but I know where the documents are, why should I have to change"

Powerful Two-Hander fucked around with this message at 10:58 on Aug 3, 2018

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=
https://cloud.google.com/knative/

Looks pretty sweet, server less functions but 1) run via docker so not limited to js and 2) runs in your own cluster so you don't pay per request or anything. im for sure going to find some way to squeeze it into my current jerk-off hobby project

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply