-
Notifications
You must be signed in to change notification settings - Fork 18
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
Reveal keywords on project's catalogue page #225
base: master
Are you sure you want to change the base?
Conversation
I am puzzled by the error message: The migration class "Migration_Add_keywords_instances_field" is missing an "up" method." I have the following settings in catalog/application/config/migration.php:
The following are the contents of catalog/application/migrations/20240516002600_add_keywords_instances_field.php
|
I'm glad you're back to work on this! I think the "fix-previous" commits could stand to be squashed together, but this chain of commits is much more linear than the last. I'll let Artom request any changes he wants or needs on that front. So, I've got some observations on what the code does, and I'll be happy to work with you on what might improve it on that front.
|
Thank you very much for this helpful initial feedback.
I did not know it was possible to “squash” git commits until now, but have just looked up some info on that, and see it is possible. Sorry you’ve having to deal with such a git (and software review) newbie here. Will wait for advice from Artom on that, as you suggest.
I’m away from my development environment for the next four days. I will look more carefully at your other suggestions as soon as I am back. Your explanations all seem very clear to me.
Before I start making any changes, I would like to wait on whatever initial advice Artom may have on how to proceed from here.
Can I assume that where I make changes to address the issues you have raised, I should, as a matter of principle, ’squash’ the commit for each further change with the previous commit affecting the same area of code?
Peter Dann
… the On 17 May 2024, at 3:19 PM, redrun45 ***@***.*** ***@***.***> Iom> wrote:
I'm glad you're back to work on this! I think the "fix-previous" commits could stand to be squashed together, but this chain of commits is much more linear than the last. I'll let Artom request any changes he wants or needs on that front.
So, I've got some observations on what the code does, and I'll be happy to work with you on what might improve it on that front.
Migration via php public_html/index.php migrate migrate went just fine! Tags appeared, all with instances at 1 until the cron job first runs. 👍
I wasn't able to call the new cron endpoint (I tried curl -k https://librivox.org/cron/Keywords_stats/update_keywords_stats), until I added an 's' to the controller file's name, to match the class, "Keywords_stats.php".
After that, I could update the stats, and tags became click-able! The numbers also look right at first blush, though I'll go back and look for anomalies or off-by-ones at some point. 😉
Clicking on a keyword took me straight to /keywords page, listing projects tagged with that keyword! 👍
It might be nice if this endpoint name was singular to match /author and /reader, but this is me nit-picking. 😝
This endpoint does not seem to reflect the sort order in the drop-down box. I think this comes down to get_projects_by_keywords_id_and_project_type in Project_model.php, where I see a sort order hard-coded.
When filtering this page by project type (solo vs group), the pagination links at the bottom still show the total number of pages. Judging by the other controllers, I think we're missing the project type constraint when defining $full_set.
—
Reply to this email directly, view it on GitHub <#225 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/APUJ53G5VJTKR34QTN3S4DTZCWHOZAVCNFSM6AAAAABHZXA4W2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJWGY3DIOBQG4>.
You are receiving this because you authored the thread.
|
I believe that's the way to go - each commit in the final PR should result in working code, even if it isn't used yet. Beyond that, it seems quite subjective, though perhaps I'm missing a convenient guideline. Myself, I'd put the PHP 8 fix and the configuration change all into the first commit, so that it results in working code that completes one "thing". All the future commits can move on from that to other "things", without changing the code from your first commit unless it's really necessary. |
e6b822d
to
eff6d56
Compare
I have had a go at addressing what I think are the major concerns redrun has expressed so far (though I'm afraid I don't understand redrun's point about the cron job endpoint, and have not addressed that). I have now had a (reasonably brutal!) first person introduction to rewriting a git commit history — the need for such, the means at one's disposal, and the many (many!) pitfalls lying in wait for the beginner. I hope I've made some useful progress in this area too. |
This looks (to my eye) much, much better! I wanted to send you to a straightforward tutorial and explanation, but the stuff I found mostly made my head hurt, even though I assimilated some of the 'how' of things. I'm glad you also "made it through". 😉 My cron job issue comes down to a test: set the I fixed it by changing the name of the file 'application/controllers/cron/Keyword_stats.php'. Since the class it implements is called 'Keywords_stats' (note the plural), I added an 's' to the filename, and then it worked. When it comes to updating a commit when there are later ones in the chain, I believe either |
356ff0b
to
d6e106a
Compare
Thanks for that explanation of the cron job issue (which should have been staring me in the face). I've fixed that now, and have pushed that change and all "subsequent" changes here again. |
.gitignore
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this must have been deleted by accident!
WHERE project_id = ' . $project_id . ' ) '; | ||
|
||
|
||
$query = $this->db->query($sql, array($project_id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't quite gotten to testing this part out, and it looks like it would work, but here's one thing to address:
I think we should put a ?
here, so that the array($project_id)
on line 22 gets escaped and substituted in its place. Line 19 would then look like this:
WHERE project_id = ?) ';
Overall, this looks to be working well enough, that I can really take a hammer to it next time I get the chance! 😆 |
Thank you. These are good suggestions.
I’ll wait to see what a good hammering may throw up before implementing them.
Peter
… On 7 Jun 2024, at 2:26 PM, redrun45 ***@***.***> wrote:
Overall, this looks to be working well enough, that I can really take a hammer to it next time I get the chance! 😆
These are all the notes I've got for now, and it's fine by me if you wait for that additional testing before acting on them.
—
Reply to this email directly, view it on GitHub <#225 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/APUJ53HQHCSFNWZW4AC4QX3ZGEY7XAVCNFSM6AAAAABHZXA4W2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJTHEYTAMJRGM>.
You are receiving this because you authored the thread.
|
Well, I've finally sat down to configure my dev box to catalog mock projects again. I need to do a PR to add this to the Ansible scripts sometime. 🤔 That was the last test I knew we couldn't do on the staging server. If you'd like to implement the changes I previously mentioned, I won't hold you up any longer, and it can go to staging. For convenience, here are quick summaries of those three things:
Once at least the first two are addressed, we'll ask if Artom can load it up on Staging for more people to play with. Perhaps along with #231, for the full experience! 😉 Then on a more personal note, I know that text isn't my best medium for building empathy. Code reviews, in particular, seem very "transactional" to me, as they're all focused on business. They'd be harder to read, if they weren't! I want to say: Thank you! In our forum conversation, I was most explicit in saying that I would not ask someone to work on our code, for reasons that extend beyond the messy code itself. But I'm glad you did. Thank you again for volunteering - and learning, and returning - to work on this anyway. To make this happen, we needed you. With the amount of new code this took, and the number of other bugs and quirks that have bothered volunteers for years, I don't know if I'd have ever gotten to such a big new feature. Between you and Gareth (and hopefully me), we've made and are making these changes in the past few months, that folks will enjoy for years, even if nobody specifically asked for them to happen right now. You and I are excited to work on the code, as and when we can. Please be patient with me, as I attempt to save other volunteers (who did not sign up to do code review or QA testing) as much work, worry and stress as possible. Significant updates come with all of those things, for more than just us folks here on GitHub. Even a small update can have unexpected quirks, and we don't want to pressure people to find them before they have to live with them. (See also: #233 😓 ) |
d6e106a
to
3432f39
Compare
I have now attempted to address all three of the technical issues you have (very conveniently - thank you!) summarised here and have pushed the changes through.On the personal side, I doubt if you can have any idea how glad and thankful I was to receive your very kind, generous and timely message. You have been the soul of discretion, and the soul of helpfulness, through this whole process, for ever acting in what I have long since come to recognise as the true Librivox spirit. If I can live up to that ethos half as well as you do, I will be very glad indeed (😃) - and probably a bit surprised, too! |
3432f39
to
935a9e0
Compare
Excellent, I'm glad my nit-picking hasn't driven you away just yet! Back to the business side, those changes address everything I know we need for this PR. You mentioned you might make changes to the other one, but I think we can call this one "Ready for Staging"!
|
Thank you. I'll try to steel myself for whatever may follow 😄! As for "the other one", l have already made further changes to #231 which I'm personally happy with. Those changes, if acceptable for staging yet, might complete the changes here nicely. |
935a9e0
to
dcb47bd
Compare
It's possible that when administrators see this capability in action, they'll be quietly (or not so quietly) horrified at some of the keywords they see are in actual use. It occurs to me that one way to alleviate this horror ever so slightly might be to provide a function that made it easy for administrators quickly to edit those keywords. While it's not necessarily ideal for this purpose, the "add_catalog_item" page does support this functionality, and it's a relatively simple exercise to add to the project catalog page a link, visible only to logged in administrators, that would take them straight to this page for the project concerned. I've mocked that up on my local development system as a proof-of-concept. Hopefully the attached document illustrates properly what I mean. |
This link looks like a nice convenience feature in general! It's much more useful for other things than for keywords, though. I did say that updating keywords is far beyond the scope of a PR. My hope all along is that this can be genuinely useful without that. 😅 I hope I haven't created a false impression that updating keywords would be a common thing: in fact the keywords containing ";" are an exceptionally easy case because they only involve the "add_catalog_item" page. I could go into a little bit more detail in a PM some other time. So far, I haven't seen any "can't you just" here on GH, but some folks may come along who don't yet know better. Perhaps this new link should be its own thing, over in the side-bar. And though I'm sorry to add more for Artom to sort through, I think a separate PR would be appropriate. |
Good idea - but sorry Artom! Have put this forward now as #234 |
dcb47bd
to
3bd3477
Compare
I attempted two pushes that address notartom's review comments so far around 14 hours ago. The changes I have made have not, as far as I can see from a quick check, "broken" anything functionally on my local development system, certainly not with respect to the new keywords displaying capability. The first push/deployment failed because I had left some glitchy code stuff in Migration.php. After I cleaned that up, I tried again. The second push/deployment has failed at a website health check. I'm not sure I know how to troubleshoot that from where I'm sitting. Would appreciate advice on how best to proceed from here. |
I think I see the trouble: this first commit includes the instruction files for running the two new migrations, but it does not set If you can also remove the change to |
86ea4c3
to
f78b513
Compare
Thanks for your advice, which I've followed as best I can. Deployment, at least, seems to have succeeded now. |
Excellent! Oh and... woops. Sorry Artom, I didn't mean do "request a review", I know you'll see this in your own time. |
It concerns me that on the list of Pull requests (https://github.com/LibriVox/librivox-catalog/pulls) this is still showing up as "Changes requested", which seems to imply that the code has been at least partly reviewed, and I have not followed up by making requested changes. This is not the case. When changes were requested more than two months ago, I addressed them pretty promptly — and have heard nothing since. |
@peterjdann Honestly, I'm not sure how to change that. All the technical changes we've requested, I believe you're up to date with. The non-technical questions are... well, moving slowly, and I hope to have some news for you on that soon-ish, but don't let the GitHub status bother you if you can help it. 😅 |
@peterjdann - It sure has been an interesting couple of months. Now that the dust is mostly settled from the Archive incident, we are looking at this again, and I think concerns are addressed to where it can go live in a far more soonish soon. Of course, there had to be one more thing. 😨 |
f78b513
to
8730536
Compare
I have had a go at addressing this. I think I understand what's involved, and have pushed through what I think is needed. Please do let me know if I've got the wrong end of the stick! |
Looks like the right end to me! The end result gets us right up to date with master. Only thing I see is that the migration version is now at 3, so the (newly re-numbered) number 4 won't be called. I might also suggest keeping the two migrations in separate commits - one of them is not "undoable", but the other is. |
e2b272f
to
4914b16
Compare
Well, I had part of the stick! Have now put the two migration actions in separate commits, and have created a separate migration version setting for each ("3" then "4"). |
OK! So, the non-technical side is all caught up. So far as admins are concerned, this can go live as soon as we're ready on this side. 👍 On this end of things, I hope you'll forgive me. I've been learning a LOT lately, and some things about the code itself are starting to click. So, sitting down for a final review with what I know now, I have some additional technical comments. Please don't hate me. 😓 |
Sounds ominous. Consider me “softened up” for the bad news, then.
… On 7 Dec 2024, at 4:15 PM, redrun45 ***@***.***> wrote:
OK! So, the non-technical side is all caught up. So far as admins are concerned, this can go live as soon as we're ready on this side. 👍
On this end of things, I hope you'll forgive me. I've been learning a LOT lately, and some things about the code itself are starting to click. So, sitting down for a final review with what I know now, I have some additional technical comments. Please don't hate me. 😓
I've started a review, but I think you'll only be able to see it once I finish and post it.
—
Reply to this email directly, view it on GitHub <#225 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/APUJ53CM6Y2XHBFHX7ABYQT2EJ75NAVCNFSM6AAAAABHZXA4W2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRUHA4TSMJYG4>.
You are receiving this because you were mentioned.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, not so bad! Nothing's a show-stopper. Mostly, I feel bad asking you to re-commit the whole chain each time there's a change. 😬
application/migrations/004_drop_redundant_keywords_from_projects.php
Outdated
Show resolved
Hide resolved
application/migrations/004_drop_redundant_keywords_from_projects.php
4914b16
to
2c1e004
Compare
2c1e004
to
3551da3
Compare
The effect of the changes proposed here would be:
In compiling this proposal, I have looked for opportunities to develop any relevant unit tests, but have not seen any.