[V3 Downloader] Update repo without cogs, update single cog #2527

Closed
opened 2019-03-18 07:29:05 +01:00 by Jackenmen · 4 comments
Jackenmen commented 2019-03-18 07:29:05 +01:00 (Migrated from github.com)

Feature request

Select the type of feature you are requesting:

  • Cog

  • Command

  • API functionality

Describe your requested feature

I would want to see [p]repo update command which would update repo without updating any cog. This could be useful when new cog is released in repo and you would want to install it without updating other cogs.

From what I've seen to make this change without breaking [p]cog update it would be required to know status of the installed cogs (if they are up-to-date) as currently updating cog is based on checking if the repo is up-to-date and if it isn't downloader updates all cogs from that repo.

Once we know the status of the installed cogs, it probably wouldn't be hard to add functionality to update individual cogs without updating other from the repo, so I thought I add this to the issue as well.

# Feature request <!-- This template is for feature requests. Please fill out the following: --> #### Select the type of feature you are requesting: <!-- To check a box, replace the space between the [] with a x --> - [ ] Cog - [x] Command - [ ] API functionality #### Describe your requested feature I would want to see `[p]repo update` command which would update repo without updating any cog. This could be useful when new cog is released in repo and you would want to install it without updating other cogs. From what I've seen to make this change without breaking `[p]cog update` it would be required to know status of the installed cogs (if they are up-to-date) as currently updating cog is based on checking if the repo is up-to-date and if it isn't downloader updates all cogs from that repo. Once we know the status of the installed cogs, it probably wouldn't be hard to add functionality to update individual cogs without updating other from the repo, so I thought I add this to the issue as well. <!-- Feel free to describe in as much detail as you wish. If you are requesting a cog to be included in core: - Describe the functionality in as much detail as possible - Include the command structure, if possible - Please note that unless it's something that should be core functionality, we reserve the right to reject your suggestion and point you to our cog board to request it for a third-party cog If you are requesting a command: - Include what cog it should be in and a name for the command - Describe the intended functionality for the command - Note any restrictions on who can use the command or where it can be used If you are requesting API functionality: - Describe what it should do - Note whether it is to extend existing functionality or introduce new functionality -->
Zephyrkul commented 2019-03-18 17:36:11 +01:00 (Migrated from github.com)

Both of these features already exist with V3.

  1. Update repos without updating cogs:
    Simply use [p]cog update and when it asks you if you want to reload, react with ❎.

  2. Update only specified cog
    [p]cog update [cog_name]

Both of these features already exist with V3. 1) Update repos without updating cogs: Simply use `[p]cog update` and when it asks you if you want to reload, react with ❎. 2) Update only specified cog `[p]cog update [cog_name]`
Jackenmen commented 2019-03-18 17:51:48 +01:00 (Migrated from github.com)
  1. But in reality cogs are updated and just not reloaded, which means that in next reload or restart of a bot, new version will be used, so it doesn't work as I suggested above.

  2. This doesn't update one cog, it updates every cog from the repo this cog is in.

1. But in reality cogs are updated and just not reloaded, which means that in next reload or restart of a bot, new version will be used, so it doesn't work as I suggested above. 2. This doesn't update one cog, it updates every cog from the repo this cog is in.
mikeshardmind commented 2019-03-18 18:40:10 +01:00 (Migrated from github.com)

I'd love to see this as part of the core behavior, including pinning cogs to specific versions, but it's not here right now. The underlying behavior of this is also why when an author updates a single cog, every installed and loaded cog shows as updated.

I'd love to see this as part of the core behavior, including pinning cogs to specific versions, but it's not here right now. The underlying behavior of this is also why when an author updates a single cog, every installed and loaded cog shows as updated.
Jackenmen commented 2019-03-18 19:45:31 +01:00 (Migrated from github.com)

Yeah, pinning cogs would go well with these changes too, true. I was wondering, how it should be handled, to make those changes possible. Everything should probably be based on commit ids as by this we could:

  • install cog from specific commit
  • pin cogs to its current state/commit (maybe also option to upgrade and then pin?)
  • upgrade cog to particular commit (which needs to be newer than the one it's currently on)
  • obviously upgrade individual cogs
  • show cogs that can be updated (this would require using git diff, which might not be good performance-wise though, there's also git diff-index, which should faster option, but I'm not git expert, so there might still be some better option)

Commit ids for each cog should be kept in conf's installed variable as we will need to operate on it in some of those functionalities.
I'm interested in helping with this, I'm not sure, if I'll be able to write all of this on my own, but I surely wanted to write my ideas on what could be implemented as it might be useful for someone else too.

And if someone thinks that something from what I said should be handled differently, it would be better to know that too :D

Yeah, pinning cogs would go well with these changes too, true. I was wondering, how it should be handled, to make those changes possible. Everything should probably be based on commit ids as by this we could: - install cog from specific commit - pin cogs to its current state/commit (maybe also option to upgrade and then pin?) - upgrade cog to particular commit (which needs to be newer than the one it's currently on) - obviously upgrade individual cogs - show cogs that can be updated (this would require using `git diff`, which might not be good performance-wise though, there's also `git diff-index`, which should faster option, but I'm not git expert, so there might still be some better option) Commit ids for each cog should be kept in conf's `installed` variable as we will need to operate on it in some of those functionalities. I'm interested in helping with this, I'm not sure, if I'll be able to write all of this on my own, but I surely wanted to write my ideas on what could be implemented as it might be useful for someone else too. And if someone thinks that something from what I said should be handled differently, it would be better to know that too :D
Sign in to join this conversation.
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 milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#2527
No description provided.