[Trivia] Move Trivia lists back home #2028
No reviewers
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!2028
Loading…
Reference in a new issue
No description provided.
Delete branch "V3/vendor_trivia"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This still needs discussion, but this means saying no to namespace packages (yay) and also everything I listed on #1973. Discussion on that issue still needs to occur, but I want to get it rolling and make a decision on this soon.
What I've done is move the trivia lists to the
redbot/cogs/trivia/data/listsdirectory. The reason I chose and extradatasub-directory is for the interest of ease of extensibility, the distribution will now include all files in an existingdatasub-directory of a package.This also fixes our issue (which has only just been recently discovered) that locale files haven't been included with the distribution since beta 9, due to a line added in #1420:
include_package_data=True. This reverts that change and also greatly simplifies the data file discovery for the distribution. I'm for more maintainable and straightforward code where possible.Here are just some explanatory comments.
The
discord/bin/*.dllfiles don't need to be in our manifest as they're not part of our distribution.As for the
redbot/cogs/audio/application.ymlfile, I've moved it toredbot/cogs/audio/data/application.ymlas we're now including everything in the data/ sub-directory of all packages if it exists (much like we do with 3rd party cogs). This reduces boilerplate and maintains consistency.Just a comment: The Pipfile.lock was simply updated as Red-Trivia is no longer a dependency. For some reason it has also included some extra markers - these have no effect so please disregard.
Since this is literally just aliasing a single function call, I removed the function and placed the raw one directly in the setup function for clarity.
So this might be your biggest question, why did I remove this function: it's over-complicated, doesn't encourage extensibility of our data files and objects to maintainability. It is achieved in a much simpler manner with the usage explained below.
include_package_datais a very misleading argument which we should never use in the interest of remaining sane. It actually forces setuptools to ignore thepackage_dataargument. Please, for the sake of any future maintainers' sanity, don't bring it back (It's not clearly documented in setuptools' documentation, if you're unconvinced that this is the behaviour, test it on a local machine).The new
package_dataargument is used in the way which is recommended in setuptools' documentation, where an empty string as a key applies the rule to all included packages.@ -0,0 +5,4 @@from redbot.cogs.trivia import get_core_listslist_names = get_core_lists()assert list_namesThis test came straight from the Red-Trivia repo.
I think I'd prefer trivia be loaded in as a submodule (still not a namespace package) here for a few practical reasons. The trivia lists don't seem to need to be under the same level of QA scrutiny as the rest of the project. They need to be kept accurate, but there aren't code paths in the questions. Leaving them in their current repo, but pulled in as a submodule allows the more lax review process for those, while gaining the other benefits.
+1 to what @mikeshardmind said. IMO, trivia lists shouldn't be in the main repo.
@mikeshardmind @calebj If the only incentive to keep them out is to bypass QA, that can easily be done by us devs simply not assigning QA members to trivia lists PRs. Besides, as we know, @MiniJennJenn manages the trivia lists, is the only one who makes PRs to add trivia lists, and those trivia lists come from #12. I don't see how this is worth separating the repos or overengineering the solution to this "problem".
Finally, does this argument stack up against those I made in #1973? If you have disagreements with what I've stated there, you're welcome to point them out.
I should probably think again before responding. For some reason I wasn't even thinking about git submodules, personally I've never used them but I understand now.
This would flatten the versioning system and it would keep them in the Red-DiscordBot distribution, which are both good things and solve two of the problems on #1973. The 3rd problem (neglect and separation) I could resolve by simply linking the ZenHub boards for the two repos (although I'm not convinced why we should separate the repos in the first place, esp. if we're only going to link their issue/PR boards back up again).
I'll look into using submodules. Thanks for your suggestions guys.
After a bit of research and testing, I've decided against the proposition of using submodules. These are my reasons:
This means we'd have to be more specific in our globs for
package_datainsetup.py- part of this PR was to make that more general to simplify the process of adding data files in the future.So for those reasons I'm sticking to this approach here.
While that's correct, we don't actually need anything but the yml files to exist in that repo if we go that route. I'm still going to advocate the submodule route due to this, but I'm not strictly opposed to simply moving it all back here.
We'd need the tests and Travis config in there at the least since we're not removing the CI on the lists. Besides, that wasn't my main gripe, it was more having to update the head of the submodule every time the trivia lists change.
Right... Just move them back then.
Despite the mixed feelings about this I'm putting it into beta 20 as a possibly temporary fix for the namespace package issues. It's also a permanent fix for all of our missing translations, and that certainly needs to be fixed for beta 20. Personally I think the trivia files are going to stay where they are regardless.