58
Root
5y

Every step of this project has added another six hurdles. I thought it would be easy, and estimated it at two days to give myself a day off. But instead it's ridiculous. I'm also feeling burned out, depressed (work stress, etc.), and exhausted since I'm taking care of a 3 week old. It has not been fun. :<

I've been trying to get the Google Sheets API working (in Ruby). It's for a shared sales/tracking spreadsheet between two companies.

The documentation for it is almost entirely for Python and Java. The Ruby "quickstart" sample code works, but it's only for 3-legged auth (meaning user auth), but I need it for 2-legged auth (server auth with non-expiring credentials). Took awhile to figure out that variant even existed.

After a bit of digging, I discovered I needed to create a service account. This isn't the most straightforward thing, and setting it up honestly reminds me of setting up AWS, just with less risk of suddenly and surprisingly becoming a broke hobo by selecting confusing option #27 instead of #88.

I set up a new google project, tied it to my company's account (I think?), and then set up a service account for it, with probably the right permissions.

After downloading its creds, figuring out how to actually use them took another few hours. Did I mention there's no Ruby documentation for this? There's plenty of Python and Java example code, but since they use very different implementations, it's almost pointless to read them. At best they give me a vague idea of what my next step might be.

I ended up reading through the code of google's auth gem instead because I couldn't find anything useful online. Maybe it's actually there and the past several days have been one of those weeks where nothing ever works? idk :/

But anyway. I read through their code, and while it's actually not awful, it has some odd organization and a few very peculiar param names. Figuring out what data to pass, and how said data gets used requires some file-hopping. e.g. `json_data_io` wants a file handle, not the data itself. This is going to cause me headaches later since the data will be in the database, not the filesystem. I guess I can write a monkeypatch? or fork their gem? :/

But I digress. I finally manged to set everything up, fix the bugs with my code, and I'm ready to see what `service.create_spreadsheet()` returns. (now that it has positively valid and correctly-implemented authentication! Finally! Woo!)

I open the console... set up the auth... and give it a try.

... six seconds pass ...

... another two seconds pass ...

... annnd I get a lovely "unauthorized" response.

asjdlkagjdsk.

> Pic related.

Comments
  • 3
    "Sounds like a fun time!" Anyway, do what you can and patch all the things!
  • 3
    Abandon the 3 yo.
    No wait, abandon the project. 😛
  • 3
    @cursee Abandon the 3 weeks old's project? :D

    By the way, @Root, if it's not too personal, how come you're already back to work so soon after having your child?
  • 3
    "I ended up reading through the code of google's auth gem instead because I couldn't find anything useful online"

    That's exactly what I ended up doing. Their documentation sucks or almost non-existent.
  • 6
    Congratulations on the new arrival! :-) In terms of the json_data requiring a file - quick and dirty solution would just be to create a temporary file, dump the data to that and then pass it to the library. Not elegant, but should at least help you get something up and running.

    Also:

    "This isn't the most straightforward thing, and setting it up honestly reminds me of setting up AWS, just with less risk of suddenly and surprisingly becoming a broke hobo by selecting confusing option #27 instead of #88."

    This is one of the best snippets I've ever seen on here!
  • 2
    stay strong :-) :thumbs_up:
  • 3
    @rEaL-jAsE Yeah. I looked for a better image for half an hour and couldn't find any. I didn't want to draw one myself
  • 5
    @Jilano Because my girlfriend had this one.

    Also, any leave I requested would not have been approved anyway: I'm not the father, so I don't qualify for paternity leave, and we're not married so it's not family leave either. It was also during a huge marketing push (while I was still building features for said push... freaking sales people). As I'm the only dev, I couldn't hand the project off to anyone else, so it was entirely up to me. I coded one of the features in the recovery room. 😕 (to be fair: they were both sleeping, but I am still irritated I had to.)
  • 4
    @Root Hum. Seems like a really complicated situation on all fronts, eh! I understand (and would be irritated too). Well, hopefully you'll be able to get some rest once everything is done/settles.

    Good luck, we're "Rooting" for you! (Ha!)
  • 1
    @Root sucks when people are like "well the government isn't involved in your relationship (you're not married) so it isn't real to us"
  • 2
    @jeeper Yeah 😕
  • 1
    @Root Damn, I'd be beyond irritated if I had to do something like that. Perhaps it's a culture difference between there and the UK, but if someone asked me to do that work a few hours after my wife had given birth, I'd be sending my resignation letter instead.
  • 3
    @AlmondSauce If I had another job lined up, I'd have sent my letter months ago.
  • 1
    @Root Sadly I figured as much :(
  • 1
    Totally got yelled at (or to go with the theme of the day: shit on) at for not finishing this project, and a lot of other related crap.

    > Boss before: "Here are three spreadsheet providers; use whichever is best, or pick another service. But it has to be a spreadsheet."
    > Boss now: "It doesn't have to be a spreadsheet! Why didn't you realize a spreadsheet wouldn't work?"

    > Me: "Because you said it had to be a spreadsheet. You were quite clear."
    > Boss: "I said a 'table.' and [topic change]"

    No, you didn't.
    Asshole.

    > Boss: "Why haven't you been talking to [contractor] about this project?"
    > Me: "I have been. I've kept him up to date on everything as I went."
    > Boss to contractor: "Do you know what this project is for?"
    > Contractor: "I have an idea? I think [wrong answer]"

    I told you exactly what this was, asshole.
    What and why. Many times. I even ranted to you about this crap!

    In retrospect, I suppose I can't expect the boss's yes-man to say something the boss doesn't like, or take my side against him when he's being an asshole.

    Moving on...

    Me and the yes-man contractor discuss alternative idea: me building the entire damned thing by myself.
    > Boss: "So after a 5-minute conversation we came up with a better idea? What have you been doing, @Root? Why didn't you do this day-one?"
    > Me: "Yeah. A 5-minute conversation after three days of discovery and deadends. Besides..."
    > Boss: [interrupts]

    Me building the entire thing is a sprint, maybe two. My initial estimate was two days. And besides, it wouldn't be one of your coveted spreadsheets! Asshole.

    He never fucking listens.
    He only bitches.

    Several days of me desparately fighting with this and doing endless research to meet my poorly-estimated timeline, and he just fucking yells at me for not knowing the answer right away, and for not going against his request.

    I fucking hate him.
    I hope some hobo bum-rushes him and shits in his mouth.
    sakdlfjasdlf.
  • 1
    @Root I am honestly amazed that you're still working for this douche. That's some crazy resilience!
  • 3
    @Avyiel What can I say? I have a lot of experience putting up with abuse.

    As soon as I find something else, I'm gone.
  • 1
    @Root parroting irene here, good luck on your search
  • 2
  • 1
    @Root likewise - good luck. Sounds like the sooner you're out there, the better.
  • 2
    @AlmondSauce Yes.
    I'm not sure how much more I can take.
  • 2
    @M1sf3t I abandoned the attempt.
Add Comment