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
Oneiros
Jan 12, 2007



MononcQc posted:

my fav bit of the kafka architecture is whenever someone notices that oh yeah topic compaction is not enough to guarantee reliable long term storage (i.e. re-partitioning fucks with all the keys and therefore linear history of entries) so you need another canonical data source to act as a kind of backup, and so what you do is put a consumer that materializes the views in a DB.

But that's nice because you can use the DB for some direct querying. Except for some stateful component doing stream analysis over historical data; every time that component restarts, you need to sync the whole state to build the thing afresh, but doing this from a DB is not super simple so you do it from Kafka, but since Kafka can't necessarily tell you it has all the data and the DB is the one that's canonically right, you end up building ad-hoc diffs between a DB and a live stream for every restart

And there's like no good solution, you just cover your ears and hope you never make it to that point because you know you'll be hosed janitoring and reconciliating two data sources that don't necessarily have a good way to talk to each other aside from some small component/microservice written in a language only 1 person knew and they left 3 months ago

Welp, time to go break the news to the team I've been working with that just implemented a new service using multiple compacted topics as long-term datastores.

Oneiros fucked around with this message at 04:01 on Oct 30, 2018

Adbot
ADBOT LOVES YOU

Oneiros
Jan 12, 2007



Maximum Leader posted:

i have a basic parent/child relationship in a database where i need to perform a basic join, problem is that the database is turbofucked by horrible decisions. the parent has fields parent/child relationship 1 through 12 containing a reference to the child instead of just putting the reference to the parent on the child. im at a loss with this, any advice guys?

fire your dba or whoever is responsible for that atrocity into the sun

Oneiros
Jan 12, 2007



floatman posted:

Tell them that they should get rid of all staging servers, push everything to production because what profit do you get from testing???

the number of times i've tried to use our staging environment only to find the main database 4-6 schema migrations / backfills behind I honestly don't know why we bother

also it's publicly accessible with "sanitized" customer info copied from prod :smithicide:

Oneiros
Jan 12, 2007



gonadic io posted:

In $oldjob I led the charge to sanitise data and overwrite the staging db with it (preferably regularly) because otherwise staging was basically unusable for e2e testing since the data there either failed constraints or took like 30 mins to correctly set up a realistic user across a half dozen different systems are their dbs

hahahahaha we used to have regular refreshes of the staging db with "sanitized" data but our ops/sre/ifnrastructure/devops/$buzzwordoftheweekteam got caught up in the company-wide OKR/SMART/WHATEVER fads and turned into a feature delivery team. then we started breaking the monolith apart into microservices with their own bespoke datastores and noone has any idea how to maintain a working staging env and wouldn't prioritize it over MORE FEATURES even if they did.

Oneiros
Jan 12, 2007



Ciaphas posted:

i'm only just starting to get caught up on this whole container fad, so I wanna check some clarification here

am I right in thinking that kubernetes is, roughly, a replacement for the part of docker that's about creating and managing containers (but still uses docker's containers, just not it's... er, factories, i suppose)?

kubernetes a container orchestration tool (can handle building, deploying, running, scaling, etc). there's also nomad (hashicorp), mesos (apache), swarm (docker), and probably a few others who I can't be bothered to remember.

very roughly speaking they're all looking to solve the same problem (how to manage hundreds of containerized applications/services across a cluster or clusters of hosts) but with different bells and whistles and optimizations.

Oneiros
Jan 12, 2007



VMs, are, well, virtual machines; you're running a full os/app stack in a virtualized hardware environment. containers use namespaces/cgroups to isolate processes & resources from each other while still running on top of the same kernel.

i.e. with VMs you can have multiple, completely distinct OSs running simultaneously on top of the same hardware/host OS thru a hypervisor. with containers you can have multiple processes/groups of processes and resources that are logically isolated from each other by the kernal. both let you generate artifacts (images, or configuration files to build such) so that you can deploy a service along with all the necessary environment (either a complete OS for VMs or whatever bits and bobs you need on top of the kernal for containers) to a generic host in a repeatable, scalable fashion.

i'm probably making hash out of it but that's my 101 level understanding of VMs and containers.

Oneiros fucked around with this message at 04:45 on Dec 13, 2018

Oneiros
Jan 12, 2007



[quote is not edit]

Oneiros
Jan 12, 2007



Powerful Two-Hander posted:

*this is my favourite: performed every single logical test by returning a magic string from the db and checking its value, not even just "true" or whatever but poo poo like if(caniDoIt = "yes you can go ahead")

Not gonna lie, someone wrote one of our half dozen feature flag / toggle / AB testing systems to operate this way and I've had a lot of fun with the magic string values.

Oneiros
Jan 12, 2007




i'll take "devs who never clean up after themselves" for $400, alex


# oneiros at MBP.local in ~/Workspace/primary_service on git:master ● [13:23:57]
→ git branch -a | wc -l
2278

Oneiros fucked around with this message at 22:35 on Jan 2, 2019

Oneiros
Jan 12, 2007



ratbert90 posted:

Jesus.

It's worse than that. They are using the branches as tags.
But also also, there is no develop or staging branch. :v:

Edit*

I wrote a script that I periodically run when I think we have to many branches.
It merges with the develop branch, and then diffs the branch with develop. If there aren't any differences the branch is marked for deletion in an autogenerated script.

Branches with merge conflicts and differences are dumped to a seperate text file for review. It's a pretty handy script!

edit edit*

The Indian team's project is so convoluted that I had to log into a LIVE PRODUCTION server and dump the SQL database to figure out what version was live because they don't print the version name on the website and there's no information as to what branch is currently live. :gonk:

uh, what's your deployment pipeline look like? i'd hope it'd record some information on what the hell gets shipped to prod. that seems more problematic than devs dirtying up the git repo with feature branches.

Oneiros
Jan 12, 2007



my favorite is when we engaged a contractor to write some sfdc apex code. the result was literally undeployable because sfdc enforces a minimum amount of test coverage and of course they wrote none.

so of course when we called them on it they spit out a 100% coverage suite that literally did nothing but assert(true);

Oneiros
Jan 12, 2007



bob dobbs is dead posted:

"sfdc apex code" is the point when your life went terribly wrong, the contractor doesnt have poo poo to do with it

honestly it's not that bad. well, other than the fact that you can't actually run the code (or tests) anywhere but on sfdc's platform because it's their bespoke bastardization of java 3 or whatever the gently caress.

i will admit i have spent entirely too much of my life cleaning up lovely apex code. n+1 db query loops for days.

even with my extremely limited experience I could probably make bank as a sfdc contractor. apparently the bar isn't just low, it's six feet under the loving ground, and from what i've seen of what we pay these loving guys it's gotta be lucrative. i'd probably end up drinking myself to death tho.

Oneiros fucked around with this message at 06:08 on Jan 3, 2019

Oneiros
Jan 12, 2007



ThePeavstenator posted:

One of my coworkers merged a branch of his into master for one of our web services today with about a month's worth of commits. It built but didn't work once deployed. Instead of swapping the slots back or just deploying the previous working build, he tried to undo the merge. He did this by using rebase on his commits instead of revert. He did this multiple times. He did this in master and pushed directly to master.

Our git history now looks like a piece of modern art, with things like commits dated 9/17/18, 4 Hours Ago, and 9/18/18 in that order all over the drat place.

Oh and the web service is still sitting there deployed in a broken state.

if you are using github or gitlab or some other managed git service i highly recommend using their protected branches features to prevent this sort of thing from happening in the future.

Oneiros
Jan 12, 2007



ThePeavstenator posted:

We do that, but the team I'm on manages our system and devops infrastructure so he's one of the 3 people other than me with the elevated privileges to do what he did.

:sever:

Oneiros
Jan 12, 2007



DaTroof posted:

i don't wanna call anyone out because maybe what i inferred is not what they meant, but in a very general sense, some people seem to think type safety precludes testing, and HOLY poo poo are they wrong

"if it compiles it works"
~ literally one of my coworkers

Oneiros
Jan 12, 2007



floatman posted:

I'm doing forced refactoring now I.e. I don't want to do it but I have to because there's a guy writing code.
Imagine a class that's a library to perform http calls to a API gateway.
Okay now imagine this library is having lots of problems i.e. calls dying mysteriously and not having correct responses returned. According to the guy writing the library, it's due to the "complexities of caching".
So what caching is he taking about? Let's say I'm going to call the library to get foo: $service->getFoo($baz). Internally, it does this:

code:
public function getFoo($baz)
{
    $response = httpClient->post("foo", $baz);
    $this->cachedResponses[__FUNCTION__] = $response;
    return (object) ["success" => true, "response" => $response]
}
So apparently the "caching" is to store the last returned response in an array in the class itself. Note that the response is cached via function name as a key, but no poo poo is given to function arguments. This means I can get 2 different responses from calling getFoo("A") and getFoo("B") but it'll be all cached in the same slot regardless with the latter call trashing the earlier call.
So how is this "cache" used?

PHP code:
$result = $service->getFoo($baz);
if ($result->success != true) {
    $response = $service->getCachedResponse("getFoo");
    ...
What the gently caress.
Bonus: the $result variable already contains the loving $response object that you need so what the gently caress?
At that point I died.

:eyepoop:

Oneiros
Jan 12, 2007



Fatty Crabcakes posted:

People complained about typos in my commit messages but then stopped when I started doing commit messages almost entirely in emoji

power move

i wish i could embed animated gifs in mine but i’ll settle for blowing up my coworkers’ inboxes with them in github comments

Oneiros
Jan 12, 2007



DaTroof posted:

i used git for years before squash or rebase seemed like poo poo i might ever need. merge was plenty adequate

even now, i occasionally run into situations where merge is preferable because we don't want to lose the branch's history

whereas i almost never use or used merge, relying on rebase almost exclusively (either rebasing my branch onto master or whatever as-is or rewriting my branch's history into more meaningful commits first).

i dunno why, i just got into the habit of frequently rebasing my feature branches on the latest prod branch. probably because i got tired of fixing a pile of merge conflicts when it came time to actually deploy poo poo.

Oneiros
Jan 12, 2007



https://twitter.com/PinoBatch/status/701215215975866372

Oneiros
Jan 12, 2007



floatman posted:

I just got asked by someone on if it was possible to access the underlying file stream descriptor of a monolog logger (PHP).

Apparently this is necessary because the "design" of the application was to:
1) create a monolog application logger with a temporary file description stream as the logging target.
2) pass this logger object down every object that's being instantiated for the lifetime of this PHP request
3) log html output to this logger object
4) once the task is completed, access and rewind the temporary file description then
5) echo the html it contains out back to a web page

It has filled me with a murderous rage.
Bonus: person claims this is a better design that previous legacy code.

:ohno:

gonadic io posted:

check ur coverage

(no really, it points out when you miss branches)

i've become increasingly interested in stuff like elixir's pattern matching function calls where you can actually just split what would be conditional branches inside a function into completely separate, easily testable functions without making actually calling those functions utterly miserable. alas, i mostly work with ruby.

Oneiros
Jan 12, 2007



floatman posted:

The company has a "pull request" policy where in theory, code changes are reviewed by "development peers" and approved before being commited to the codebase. But what I'm starting to feel is that these PR reviews are ultimately very shallow and just end up being white space and punctuation changes, or at most superficial changes to one to three lines at most.
Either that process is flawed and fails to reveal these kind of "HURRR DURRR let's statefully hold generated HTML content in a logging framework" constructs or apparently I'm the first dev to have taken an issue to this.
I dunno man are PRs useful or are they only useful when the general quality of Devs are on average higher than circus clown

i've had a two thousand line pr (the terrible programming is mine) where the only feedback was "why do you put two spaces after a period?"

those sorts of reviews come from people who don't have the capability and/or the interest to meaningfully review the work. either all the changes are perfect (unlikely), people are being forced to do reviews for poo poo they aren't involved in (blanket review policies), or they're incompetent. or some combination of the three.

Oneiros
Jan 12, 2007



the number one cause of outages/service disruptions at my company is bad deploys, it's not even a close contest. it's incredible how many devs don't test their code at all (like, not even bothering to run it) and how many more just blindly approve PRs. best case you ship something that immediately and obviously blows up and you have both the monitoring/alerting to detect it and the processes in place for quick rollbacks. worst case you ship something that silently fucks poo poo up for days/weeks/months before it becomes apparent.

Oneiros
Jan 12, 2007



Arcsech posted:

unless it’s really ridiculous, just leave it for the pr and when you merge do git merge --squash

GitHub and gitlab have an option to make the merge button in the UI do this by default

this is the correct answer. i like to treat PRs as the atomic unit and have pretty much never seen anyone take issue with or need to (or be able to without horribly breaking poo poo) revert a single commit of a multi-commit PR.

Oneiros
Jan 12, 2007



DaTroof posted:

and we can't wait to get those apps started after we're done gluing together a usable framework from 300 disparate node dependencies

AggressivelyStupid posted:

I love having a 350mb node_modules folder

last time i installed/ran our front-end service locally it was over two gigs on disc and the npm dependency list was over 1000 lines long. it takes about five to ten minutes to bootstrap and basically makes my dev machine unusable while doing so.

gently caress web development

Oneiros
Jan 12, 2007



Private Speech posted:

what uhh, what does it .... do

at least in general terms

queries the backend for data with tons of redundant / duplicate requests because no one understands debouncing / locking then presents it to our users in half a dozen subtly different visual design patterns and with various parts of the page contradicting each other because there's no consistency between the various backend services and everything is async. and live reloading, which i guess is a vitally important feature, except when it breaks. also half the time the backend throws a 500 the front-end does nothing because error handlers are just straight up missing.

Oneiros
Jan 12, 2007



i'm currently betting on whether we'll make it a year between all-hands presentations on how yes, the current js framework is a dumpster fire and everyone hates working on it but this "new" js framework is totally gonna solve all our problems. we have three in various degrees of active use / decrepitude.

in more homegrown terrible programming news, i recently discovered that my team's service's build script was caching every ruby gem we've ever pulled in and then copying them all into our deployment docker image, which would explain why the drat thing had grown to over a gig (not that it's particularly svelte after trimming that poo poo out). i've had a really bad habit of not paying much attention to infra & testing stuff during reviews (not that i'm much more than a novice in those areas myself) and i'm gonna have to fix that because god drat the entire build/deploy pipeline is a ticking time bomb waiting to blow up in our faces.

Oneiros
Jan 12, 2007



Boiled Water posted:

today in “the state is terrible at programming”: we have a db in which each field can be at the most 4kb (which is fine) but it also has a field pointing to an xml file which when empty is 2gb. yes this file is always present for each row even when empty

:eyepop:

this week i learned that our new deployment system uses staging infrastructure as less privileged resources for production deployments. guess what happens when someone is doing maintenance (or just loving around) in staging.

Oneiros
Jan 12, 2007



the talent deficit posted:

redshift is really good at joins and aggregates and absolutely nothing else

i dunno it is also really good a being a bottomless money pit because it is cheaper to pay aws for more bigger computers than it is to hire someone to design a proper schema and queries

Oneiros
Jan 12, 2007



MononcQc posted:

npm certainly allows it and has done so for a long long time if not forever. For example, npm3 even advertised examples where version clashes were the thing: http://npm.github.io/how-npm-works-docs/npm3/how-npm3-works.html

The tool didn't even get actual lock files until version 5, and it has taken tools like yarn to actually prevent the flat installing of duplicated deps because that one tries harder. But even today, it doesn't work naturally. If you look at the current yarn lock file for React, you can see some libraries are duplicated in the locks:

https://github.com/facebook/react/blob/master/yarn.lock#L3113-L3121 shows 'bytes' at both 3.0.0 and 3.1.0
https://github.com/facebook/react/blob/master/yarn.lock#L3179-L3187 shows 'callsites' at both 0.2.0 and 3.0.0
https://github.com/facebook/react/blob/master/yarn.lock#L3197-L3210 shows camelcase with 3 different locked versions

But it gets worse:

pre:
$ cat yarn.lock | awk -F@ '/^[^ ]/ {print $1}' | sort | uniq -c | sort | tail -n5
      4 source-map-support
      4 strip-ansi
      5 async
      5 yargs
      6 kind-of
$ cat yarn.lock | awk -F@ '/^[^ ]/ {print $1}' | sort | uniq -c | grep ' 1 ' | wc -l
1056
$ cat yarn.lock | awk -F@ '/^[^ ]/ {print $1}' | sort | uniq -c | grep -v ' 1 ' | wc -l
256
$ cat yarn.lock | awk -F@ '/^[^ ]/ {print $1}' | sort | uniq -c | grep -v ' 1 ' | awk '{i+=$1} END {print i}'
749
In today's React, there are currently 6 versions of the 'kind-of' library locked and presumably fetched by default (that's before your own dependencies come in play). In total there are 1056 libraries installed just once, and at least 256 libraries installed more than once (for a total of 749 instances).

E: I may have accidentally dropped all the packages with names starting with @ so it's possibly worse than it looks.

the first time i cloned our front-end repo and ran npm install i literally stared slack-jawed as the 1500+ line list of dependencies scrolled by.

so far i’ve been almost entirely successful in never having to actually work on the damned thing.

Oneiros
Jan 12, 2007



abigserve posted:

In 2019 if you are editing config files on the server you have made some bad mistakes

:sweatdrop:

Oneiros
Jan 12, 2007



yeah, the thing is there's a ton of people who have absolutely no understanding of the systems and tools they work with and just copy-paste poo poo from blog posts and stackoverflow. case in point i've been lurking in a multi-week long thread debugging cache miss issues with our memcached ring and it's abundantly clear that no one involved has any idea how anything involved actually works and are conflating multiple issues and suggesting fixes that in no way, shape, or form have any relation to the problem(s) encountered.

alternatively, they know something but cling to faulty assumptions about how things are actually setup.

Oneiros fucked around with this message at 05:57 on Nov 26, 2019

Oneiros
Jan 12, 2007



Doom Mathematic posted:

It would be amazing if programming jobs were like Advent of Code. Tiny, fixed-sized, rigorously specified, closed problems with singular correct answers.

can you imagine a manager ever giving a spec as well written as the typical advent of code problem?

Oneiros
Jan 12, 2007



DaTroof posted:

what's the pospinion on elixir? i might get assigned to a phoenix project and if so i have about a week to learn it


Arcsech posted:

elixir is good if you are writing a thing that is in its wheelhouse. that is, high concurrency, not too much in the way of heavy number crunching, not too much in the way of giant data structures you’re passing around. basically it’s good at all the junk people claim server side javascript is good at. if you try to use elixir for something it’s not good at, you’ll know, because it will be incredibly painful

it’s superficially like ruby, but that’s just syntax-deep, it’s super different otherwise. spend some time learning the BEAM primitives and OTP and the whole Erlang philosophy, because that will be valuable even if you don’t end up using elixir professionally.


redleader posted:

ruby 2.0, but if no one used it

as someone who primarily works with ruby but has done some tutorials / played around with elixir, this it pretty much it. from my (limited) experience it seems really nice to work with for functional programming / concurrent / actor-pattern stuff but if you don't have a need for that it's kinda pita. for what it's worth i've tried to take some of the elixir idioms / principles / constraints i've been exposed to (mostly from dave thomas aka "the coding gnome") and apply them to the ruby projects i work on and have had pretty good results.

Oneiros
Jan 12, 2007



toiletbrush posted:

dogmatically writing unit tests is good to learn because unit-testing multiplies the pain of bad code x100 so it teaches you to architect things better, but once you've learned your lessons it's less valuable. You should deffo aim for 100% automated coverage but higher level testing is what actually proves your app works.

The exception is any code tainted with algorithms involving dates, strings, money or floating point which should be unit-tested to uncurse it

i've found that extensive unit testing exposes weaknesses in design quite effectively; anytime i've found difficulty in testing it's been readily remedied by refactoring till the pain points are gone.

even with time-sensitive tests you should be able to test appropriately. if you can't i'd question the underlying design of your code.

Oneiros
Jan 12, 2007



Soricidus posted:

we're moving to a nanoservice architecture. each time a new user registers, we spin up a container to hold their data

i have heard people unironically advocate for spinning up an on-demand microservice mesh for every customer/account/user

Oneiros
Jan 12, 2007



Xarn posted:

I am going to blow your mind.

You can set up your CI so it runs tests on a virtual merge commit :2bong:

i once saw a ci setup that:

1) cloned the repo
2) checked out the feature branch
3) git --hard reset to origin/master
4) merged master into the "feature branch"

people were wondering why tests were failing after merging :allears:

Oneiros
Jan 12, 2007



Jabor posted:

presumably you are submitting some kind of change where the description is "update X dependency to version Y", whether that's a change to your copy of the dependency's code or to your lockfile or whatever.

nobody's going to look at the contents of that change after-the-fact, who cares how many bytes it is?

at least with vendoring you have the potential of having the source changes in deps actually being reviewed. no way in hell your typical dev at your typical shop is gonna dig up the changelog for dependency update out-of-band.

or maybe i've just worked at lovely places :shrug:

poo poo, at this point i'd consider myself lucky to have coworkers who are even competent enough to read a change log to figure out when a bug was introduced or fixed in a dependency.

<edit>

basically, if you've got coworkers capable of reading and comprehending the text that is displayed on their monitors, you're in good place

Oneiros fucked around with this message at 09:37 on May 25, 2020

Oneiros
Jan 12, 2007



Shinku ABOOKEN posted:

DO_NOT_USE_OR_YOU_WILL_BE_FIRED

i may created some fields in sfdc with this sort of naming scheme/description warning against deletion and modification

it worked for several years

Oneiros
Jan 12, 2007



CPColin posted:

I like that every time JIRA releases some bullshit UI change that's even slower, they respond to all my angry tweets with "plesse DM me so I can better understand the issue :ohdear:" and I just reply "it's poo poo"

we had a pm who oversaw a big ui refresh that basically everyone who actually used the product hated (lots of retina-searing white space, inexplicably large fonts and margins bumping critical information below the fold, just straight up breaking a bunch of things, etc) and their response to all the criticism was literally "they'll stop complaining in a few months"

i don't bother giving detailed feedback anymore

Oneiros fucked around with this message at 05:02 on Jan 20, 2021

Adbot
ADBOT LOVES YOU

Oneiros
Jan 12, 2007



i've been on a team where the whole story-pointing and velocity measuring and planning and poo poo went pretty dang well. it took nearly two months (3-4 sprints) to establish velocity and our lead was really good at breaking work up into chunks that the team could comfortably estimate and reliably work on. of course the moment anything (boss's boss) disrupts the sprint you have to toss the whole thing in the garbage and it all went to hell when we got to some fuzzier poo poo that required lots of research and trial-and-error. but for a good year or so it went smoothly and we could actually give reasonably accurate projected completion dates and poo poo.

<e> doing so required constant pushback against management who were always trying to gently caress with the numbers or set deadlines before work had even been written up and estimated

Oneiros fucked around with this message at 07:17 on May 22, 2021

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