Programming

I’m sitting here blocked all day over it, because I am running our pipeline now and I wanted to push some changes to it, but I can’t test it really til this derp is done triggering our auto tests. I could just disable them on my end, but it’s been kind of nice having an excuse to just sit back. I’ve been going absolutely nonstop for several weeks now.

lmao yikes. I’m admin on my work’s repo and disabling that was one of the first things I did. Also can’t push if you fail unit tests or lint. GTFO with your shit code.

Haha yea. I mean we informally have a lot of these policies and since we are small, it kind of just works ok when everyone is on the same page. My main devs create PR’s and know when it’s ok/not ok to push to master (quick fix to documentation, for instance, is pretty much fine). They won’t just randomly merge PR’s either. I’ve seen it happen once or twice but it was never an issue.

I probably need to recommend formally putting some kind of policy in place, but we usually have so many other fires to put out these kinds of small procedural things get pushed down really quickly.

Most of the engineers that used to push shitty crappy things are gone now too, so I feel even less need to address this formally. There was one in particular I can remember used to just push stuff INTO PRODUCTION (which for us just means, sending something to a client) without ever having tested it at all. I knew for a fact it hadn’t been tested, because I’d go to run a script or something and it’d fail on a syntax error in the 5th line or something. Like that’s just so inexcusable to me. On my watch now that kind of thing isn’t even possible, it’d never get past me. But that used to happen all the time.

For any project of any size over, like, 3 people, there’s never any reason to be able to push to master directly. Always PRs and always 1+ approver.

Yea, I agree, but another problem we have is we don’t really have anyone to review things. When I started everyone was so completely independent of everyone else’s work that there often was no one even remotely qualified to review their work (and our stuff’s pretty complicated sometimes). Often, now it falls to my boss, who sometimes lets them pile up or rubber stamps things.

I’ve tried to address this by removing the “island” nature of everyones work and having everyone at least surfacely aware of what everyone else is working on. Its starting to work but it’s been super slow and painful.

yeah if no one is capable of reviewing anyone elses work uh that says a lot right I mean someone should know the minorest to be able to say “this looks ok” or “this looks like it needs changes” for everything at any company with more than 5 developers right?

we dont have 5 developers. but this is really complicated C code or huge infrastructure projects that no one has the bandwidth to look at in any detail. In my mind, it’s because we don’t parcel the work out in small enough chunks. We give big, vague (less vague since I came) things we want accomplished and just expect people to do them.

My boss is a little obstacle in this. I don’t think he even knows or realizes it. But often I don’t know the technical details thoroughly enough to divide the work into small chunks, and he’s reaaaaally bad at planning. And usually the nature of the work is defined poorly enough that even on a requirements level I can’t break it down much, even when I seek more clarification.

anyway dont mean to bitch about my job here, sorry, just an ongoing struggle. I think I’m slowly winning though. A lot of the pain is my own learning curve, having no experience and kind of put into a position that needs a little.

the good news about my job though, after I lost most of my team I have already found one really strong candidate that I really, really like and works well with the rest of the team. He’s a bit headstrong but I really like it because he’s smart as hell and not shy about speaking up when he knows he’s right. And then we’re gaining another that’s supposed to be pretty good.

You have a user table with a username that has a constraint to be unique. If someone registers with that same username and you want to warn them that the username is taken do you:

(a) Check if the name is taken and put up the message if it is

(b) Read the warning code from the database

I’ve generally done (a), because it seems foolproof, but it also seems inefficient. Is trusting that the db will always throw the same error code for this error a problem? (mysql, well, actually MariaDB, but same diff I think)

Man this is the age old question i.e. should the UI display the hard coded error message from the db, or should it display a hard coded translation of the usually 401 or 403. I have never been able to answer that.

Who is the audience? I mean, what are they supposed to do with the information? If I’m on someone else’s website is there anything I can do if I get the error? If it’s an internal tool is it something that’s going to show up in an escalation? We have a hard time getting our devs to prioritize internal reporting tools having accurate or complete fucking information so you’re ahead of the game asking the question…

Hahahah preach

DevOps question

I have a project that I’ve been developing on my laptop. I’m at the point now where I’m moving it onto my remote (linode) server. I’m sure I should have been using Git from the beginning, but didn’t. I started the git repo on my laptop and on github and pushed the files I thought I needed from my laptop to github. I cloned the github repo on my linode server and pulled the files onto it.

Now I already did this, and it worked, but maybe not a good practice? Anyway, I just added the package.json (project is React front end, Python back end) and then npm installed rather than moving over all the node/js/react whatever files. That worked (after adding a file I missed - ie “npm start” started it.

Now I’ve got to do something similar with the python virtual environment and wondering if that’s the right way to do it. Should I just create a virtual environment on the remote server or add all the files to git? Partly I’m thinking of doing this differently (adding all the files) because I don’t know that there’s the same kind of “package.json → npm install” thing that makes it so the environment is the same as it is on my laptop. But then, maybe my laptop being a PC and the remote server being ubuntu has some impact and I should just create the venv over there separately?

Kinda generally, do you use git to track stuff that you didn’t write or create as part of your project?

edit: I see there is a similar thing to the package.json “pip freeze > requirements.txt”. I’m going to try that and just adding the requirements.txt file to the repo.

Well, it took me a day and a half, but I have everything running on laptop and remote and all the files I’m changing on git and apache configured right. I tried to take some notes so it won’t all be so hard to figure out next time.

Next up is a little scripting so I can turn on and off all the services I’m using in one command, run things in the background and do that and something that automatically restarts services if they fail. Any advice there welcome, but I’ll start working on it.

With npm the best thing I have found is to do everything via npm. You can even define your own npm commands in package.json and call them like “npm run (command name).” I can show you the build file I have for my current project - it has a lot of these. “preinstall” is a good build step too - if there are prerequisite steps needed before an npm install they will get called before the install goes off.

But basically, idk if this answers your question, but you should try to set your project up in a way where you can do “npm install” and basically everything is where you need it to be. Commit anything to git that is not generated by an install (eg dont commit binaries). Don’t commit stuff like node_modules (or whatever the equivalent is in react, it contains all the dependencies) or stuff that’s generated like package-lock.json (although some do, I’m not sure - I don’t see the point).

Yeah, I did that and it worked out well. I did also make a change in the package file to execute the npm stop. Doing the same thing with the requirements file for the python environment did not work so well though. I’m not sure why. I ended up using a virtual environment that was already on that machine. I did get a bash script running to start everything up or stop everything in one command.

The CTO and stakeholder for a project I’m managing recently threw a total shit fit over a release I pushed to a devel branch because it “broke all their tests.”

I noted in the push that I thought the tests had obvious errors like typos in the expected error message. Instead he escalates to my boss and CEO and his CEO, says this has been a pattern (it hasnt) and made a threat to go with a different product (contractually they cant).

My boss and I agreed it seemed like he was behind schedule (not due to us) and trying to cover his ass by scapegoating me. Probably doesnt help this is shortly after they found out I used to be a boat captain, although that’s probably just my insecurity speaking.

So I apologized and tried to slowly diffused the situation and then it turned out EVERY single error was caused by a push by one of THEIR devs 2 days prior. So not only did they not test (which they accused me of) they broke their own tests and blamed me for it.

I pushed a fix to their tests and noted the issue. What else should I do? I’m super displeased/pissed off. The thing that makes me most upset is it is really damaging to our companies’ relationship, and it was so backhanded/unnecessary. I can go back and have documented how they’ve never mentioned any issues until now, and quite the contrary actually - they’ve been singing my praises until last week. The email he sent to my bosses made absolutely no sense, and he didn’t even have the balls to CC me on it.

That may have been the final straw for me for this place. My job is so fucking thankless. I pull 60-75 hour weeks normally. I have to be available weekends and evenings. I get blamed for everything even when it is not even remotely my responsibility or fault. I have yet to receive one single recognition or word of praise for the value I have brought to the company - not sure it is because they do not recognize it or they fear I will ask for a raise (probably the latter because I’ve tried a few times now).

Preparing my resume. This shit just isn’t good for me at all. I’m gonna try to be an individual contributor for a while until I get my health in order.

1 Like

I know it feels really bad… but just know that you’ll probably have very little difficulty finding another job, and that it will almost certainly be better. Also you’ll feel an enormous sense of relief the day you quit. There are few feelings like it tbh… I’d be looking to feel it again if that wouldn’t mean suffering through months of abuse at a shitty job to get it.

The thing is it’s my first real job and most positions want 2 years experience and I sort of want to hit that marker or get very close. I am 6 months away from 2 years.

If I don’t get a very large scheduled raise in january it is game over 100%.