Skip to content

Fixing errors from testing #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 15, 2021
Merged

Fixing errors from testing #53

merged 2 commits into from
Jul 15, 2021

Conversation

alexhanna
Copy link
Member

Four changes I discovered after testing. @davidskalinder -- do you want to review these?

  1. Readded in Date in the models.py. Not sure why this was removed.
  2. Removed the extra _del_event function in mpeds_coder.py.
  3. Renamed actors-freeform back to persons-freeform. Not sure why this was changed.
  4. Checkboxes were not being committed correctly with POST so I added a null parameter and added some controller code to handle this.

@davidskalinder
Copy link
Collaborator

Hmm, these are a little strange for two separate reasons:

  1. Readded in Date in the models.py. Not sure why this was removed.
  2. Removed the extra _del_event function in mpeds_coder.py.
  3. Renamed actors-freeform back to persons-freeform. Not sure why this was changed.

The strange thing about all of these is that I can't find any of them in our master branch (i.e., Date is still there, there's only one del_event, and there are no freeforms in the event creator block file at all); and I don't think I would have changed them after PRing. The three possibilities I can think of are:

  1. I did actually change them without PRing and forgot about it
  2. They got removed somehow while merging the PRs in
  3. You changed something since they were PR'd

Maybe it doesn't matter, but it makes me a little nervous that all these things unaccountably went wrong... Is there a handy way to see which commits introduced the bad lines and I can check to see if they're in any of our branches (or maybe you can check this all on your end with superior PR-fu)?

  1. Checkboxes were not being committed correctly with POST so I added a null parameter and added some controller code to handle this.

This one is weird because we've been using all of this code for quite a while and haven't noticed any problems with the checkboxes (which sweet jeebus I hope we would notice). How were they going wrong exactly?

@alexhanna
Copy link
Member Author

Hrm, I think this mainly went wrong in PR #34. I have introduced another _del_event function in the merge I did to resolve the conflict.

I'm not sure about item 4, however. I didn't see anything which changed that.

@davidskalinder
Copy link
Collaborator

Hrm, I think this mainly went wrong in PR #34. I have introduced another _del_event function in the merge I did to resolve the conflict.

Okay so the extra _del_event was from the merge; could that explain the Date going missing also? I think that line would have been changed (and in our code the Date field is closer to the end of the line so maybe it got missed).

The freeform stuff seems more likely to have been something you introduced for your project maybe? Since I don't think we've ever had any freeform fields...

I'm not sure about item 4, however. I didn't see anything which changed that.

What was the buggy behavior? Testing both our master and pure-upstream branch just now it seemed to me like checkboxes were working as expected...

@alexhanna
Copy link
Member Author

Okay so the extra _del_event was from the merge; could that explain the Date going missing also? I think that line would have been changed (and in our code the Date field is closer to the end of the line so maybe it got missed).

It could explain this, yes. Not sure where the freeform stuff is from, but it wasn't actually implemented anywhere, I don't think.

What was the buggy behavior? Testing both our master and pure-upstream branch just now it seemed to me like checkboxes were working as expected...

It would throw a 400 error (Bad Request). Technically, if you merged in the change I made to the controller, it shouldn't change anything but just enforce a null for the text.

@davidskalinder
Copy link
Collaborator

It would throw a 400 error (Bad Request). Technically, if you merged in the change I made to the controller, it shouldn't change anything but just enforce a null for the text.

So the coder would see the 400 every time any checkbox changed? If so then we definitely would have noticed that and definitely haven't been seeing that behavior. So uh... yeah I remain puzzled/paranoid about why that would be happening now.

It could explain this, yes. Not sure where the freeform stuff is from, but it wasn't actually implemented anywhere, I don't think.

Hmh. The bugs are in MPEDS:master already? If so then I guess I can pull it and have a look at the git-blames just to assuage my doubt huh

@alexhanna
Copy link
Member Author

Yeah... idk. Pulling now.

@alexhanna alexhanna merged commit 6764f29 into MPEDS:master Jul 15, 2021
@davidskalinder
Copy link
Collaborator

3\. Renamed `actors-freeform` back to `persons-freeform`. Not sure why this was changed.

Okay so this one is from 03a1633, wherein it looks like I tried to reset some templates to the versions your team was using after cavalierly changing them. My guess is that I restored an older version. So yeah this one makes sense (and fix it however works).

On to the next one. I actually kind of enjoy git-bisecting

@davidskalinder
Copy link
Collaborator

1. Readded in Date in the `models.py`. Not sure why this was removed.

Okay yeah I can confirm that this one happened in today's merges (not sure where exactly since I don't want to bisect two changes, but Date was in there at the end of the line until today)

@davidskalinder
Copy link
Collaborator

And you said you did the _del_event thing. So that's all of those then.

That leaves the checkbox thing, which I'd like to understand so I can confirm we haven't been losing a bunch of checkbox data for months. Lemme see if I can replicate the behavior from a few commits ago...

@davidskalinder
Copy link
Collaborator

Hmm @alexhanna do you know a commit where the page would load at all but the checkboxes were broken?

@alexhanna
Copy link
Member Author

I don't. 🙃 I'm not sure what could have pushed that change. If it's helpful, you could look around changes to line 280 in shared.js.

@davidskalinder
Copy link
Collaborator

Hah, okay. But there should be such a commit right? Like it didn't only happen with some uncommitted changes or something?

@alexhanna
Copy link
Member Author

That would make sense in theory. My worry is that there was some systems update (not sure, like in Python versioning or JavaScript) which broke it.

@davidskalinder
Copy link
Collaborator

But those didn't happen today, right? So there should be some commit from today that I can checkout and load the coding page and replicate the 400?

@alexhanna
Copy link
Member Author

Hypothetically, yes? If you look at the last commit before this PR, right?

@davidskalinder
Copy link
Collaborator

Hypothetically, yes? If you look at the last commit before this PR, right?

Yeah, but that one gives me a 500 when I try to load anything.

Starting a little earlier, I managed to get the 400, which I seem to have introduced almost exactly a year ago in 651b368. But I can't seem to find how it got fixed in our version and not in yours. I guess it's possible that I fixed it in a branch I haven't PR'd (yet?) and then did a lousy job of packaging the PRs.

I'll have another stab at finding when the fix went in, but this does make me feel better that we haven't been losing any data since this error was obvious enough not to have lasted long... But also it'd be nice to see how it got fixed in the first place.

@alexhanna
Copy link
Member Author

Ah, weird. Why does it give you a 500? What does the Apache log say?

Do you see how it got fixed in my last PR? Did you make a similar change in your branches some place?

Thanks for hunting this down, regardless.

@davidskalinder
Copy link
Collaborator

Okay, got it: the fix is at 3ec2d88, which makes sense -- I remember that business about changing the field from required to optional. So that fix might be better than the new one I think?

But now it'd be nice to track down why that fix got overwritten today...

I think the 500 was from a DB config problem btw, so I had to find a commit that had one bug and not the other.

@alexhanna
Copy link
Member Author

Ah yeah I like that fix more. Do you want me to push it?

@davidskalinder
Copy link
Collaborator

Yeah go for it. I'm not sure how it wasn't in there already, but I guess it doesn't matter much now that we know how to fix it?

@alexhanna
Copy link
Member Author

All right, done in #54.

@davidskalinder
Copy link
Collaborator

Okay cool.

It's really nagging at me now why that fix wasn't in even though the commit with it was, but I'm out of debugging time for tonight. Maybe tomorrow I'll either figure it out or realize why it doesn't matter.

Thanks for all the PR work today btw! Exciting times

@alexhanna
Copy link
Member Author

Very exciting. Maybe next time it won't take me a literal year to get to PRs.

@davidskalinder
Copy link
Collaborator

Okay I think I see what happened with the checkboxes. It looks they actually got merged in properly at 663249d but then immediately got clobbered back by the merge at 7562711, which was a branch that predated the fix. I'm guessing this would have created a merge conflict, but it would have been awfully tricky to spot which version was correct without looking at the commit dates (and maybe even then?).

There is also a difference between those two branches on whether the @app.route line for that function allows both GET and POST or only POST... ATM, it's set to allow both, which was the way it was in the earlier commit; but OTOH I don't think the later commit explicitly fixed that, so it was just a true merge conflict. I assume there's no harm in allowing GETs there since they shouldn't be used anyway, so I think it's best to leave it as it is unless we remember/discover a good reason to change it...

Version control is hard, huh. I'm not sure how we could have done this to avoid this snafu aside from doing the PRs closer to when they were written so that we kept the temporal order and so they were fresher in our minds...

Anyway I think these are all now explained and fixed, so I'll close this. It does make me wonder though whether I should have a quick check to make sure that the functionality of each accepted branch has indeed made it in...

@davidskalinder
Copy link
Collaborator

I'll close this

Whoops already closed I guess. I need to lrn2PR better heh

@alexhanna
Copy link
Member Author

Thanks for sleuthing this. I think having stricter PR discipline is important as well... e.g. accepting things in order (which I didn't). Eeep.

@davidskalinder
Copy link
Collaborator

Yeah I blame past-me, who had even less git skillz than present-me

@alexhanna
Copy link
Member Author

At least you sleuthed it. Current-me would have ignored it. Absolute git-newb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants