12
204
Fork
You've already forked soju
50

Clarify migrate-logs usage #404

Open
nickh wants to merge 2 commits from nickh/soju:master into master
pull from: nickh/soju:master
merge into: emersion:master
emersion:master
emersion:chathistory-end
emersion:proxy-proto-http
emersion:set-account-password-ext
emersion:fileno-listener
emersion:backlog-test
emersion:v0.10
emersion:webpush-state
emersion:feature-introspection-username
emersion:v0.6
emersion:v0.2
First-time contributor
Copy link

Initial reading of the usage led me to believe that the messages would be migrated to a new database.
When running the command this way a new, essentially empty database would be created and the
program would exit without an error. After reading the code it became clear that the messages
should be stored in the existing database that holds the user information.

This update to the usage string should make the behavior clearer to users.

Initial reading of the usage led me to believe that the messages would be migrated to a new database. When running the command this way a new, essentially empty database would be created and the program would exit without an error. After reading the code it became clear that the messages should be stored in the *existing* database that holds the user information. This update to the usage string should make the behavior clearer to users.
Clarify migrate-logs usage
All checks were successful
builds.sr.ht Job completed
6f4376a568
nickh force-pushed master from 6f4376a568
All checks were successful
builds.sr.ht Job completed
to 6bed47be5e
All checks were successful
builds.sr.ht Job completed
2026年06月21日 08:32:47 +02:00
Compare
@ -25,2 +24,2 @@
intheformatof"driver:source"wheredriverissqlite3orpostgresandsource
isthestringthatwouldbeintheSojuconfigfile.
MigratesexistingSojulogsstoredondisktotheSojudatabasethat
storestheuserinformation.The<destinationdatabase>isspecified
Owner
Copy link

Nit: dropping "the" would be more idiomatic.

This wording kind of makes it sound like there are multiple soju databases with different purposes.

Nit: dropping "the" would be more idiomatic. This wording kind of makes it sound like there are multiple soju databases with different purposes.
Author
First-time contributor
Copy link

The point of using "the" was to emphasize that there is only one database. The original wording in the usage led me to initially think that the there would be a separate database for the messages.

The point of using "the" was to emphasize that there is only one database. The original wording in the usage led me to initially think that the there would be a separate database for the messages.
Author
First-time contributor
Copy link

Hmm, looking at this again, I'm now not sure which "the" is being referred to here.

Hmm, looking at this again, I'm now not sure which "the" is being referred to here.
@ -26,1 +24,3 @@
isthestringthatwouldbeintheSojuconfigfile.
MigratesexistingSojulogsstoredondisktotheSojudatabasethat
storestheuserinformation.The<destinationdatabase>isspecified
intheformatof"driver:location"wheredriverissqlite3orpostgres
Owner
Copy link

location doesn't work very well for PostgreSQL. source is the wording used in the man page.

It's a bit confusing with <source logs> being something entirely different.

`location` doesn't work very well for PostgreSQL. `source` is the wording used in the man page. It's a bit confusing with `<source logs>` being something entirely different.
Author
First-time contributor
Copy link

I agree that it would be best to use language that is consistent with the man page, but unfortunately in this context doing so is somewhat misleading. For migrate-logs the database is really a sink, not a source (not 100% true since it extracts some user data).
In my mind I think a better word might be "store", but I'm not sure if you are interested in having such a change to all the documentation.

I agree that it would be best to use language that is consistent with the man page, but unfortunately in this context doing so is somewhat misleading. For migrate-logs the database is really a sink, not a source (not 100% true since it extracts some user data). In my mind I think a better word might be "store", but I'm not sure if you are interested in having such a change to all the documentation.
@ -27,0 +24,4 @@
MigratesexistingSojulogsstoredondisktotheSojudatabasethat
storestheuserinformation.The<destinationdatabase>isspecified
intheformatof"driver:location"wheredriverissqlite3orpostgres
and<sourcelogs>isthestringthatwouldbeintheSojuconfigfile.
Owner
Copy link

The intent of the original wording is that the source part of the database string would be "the string that would be in the Soju config file". Here it's switching the meaning to <source logs>, and leaves source/location undefined.

The intent of the original wording is that the `source` part of the database string would be "the string that would be in the Soju config file". Here it's switching the meaning to `<source logs>`, and leaves `source`/`location` undefined.
@ -27,0 +26,4 @@
intheformatof"driver:location"wheredriverissqlite3orpostgres
and<sourcelogs>isthestringthatwouldbeintheSojuconfigfile.
Exampleusage:migrate-logs/var/lib/soju/messagessqlite3:/var/lib/soju/main.db
Owner
Copy link

Maybe we could give an example with the original and desired message-store directives from the config file, and the CLI arguments for the script. Something like:

To switch from this old message store configuration:

db sqlite3 /var/lib/soju/main.db
message-store fs /var/lib/soju/messages

To this new configuration:

db sqlite3 /var/lib/soju/main.db
message-store db

The following command line can be used:

migrate-logs /var/lib/soju/messages sqlite3:/var/lib/soju/main.db
Maybe we could give an example with the original and desired `message-store` directives from the config file, and the CLI arguments for the script. Something like: To switch from this old message store configuration: db sqlite3 /var/lib/soju/main.db message-store fs /var/lib/soju/messages To this new configuration: db sqlite3 /var/lib/soju/main.db message-store db The following command line can be used: migrate-logs /var/lib/soju/messages sqlite3:/var/lib/soju/main.db
Author
First-time contributor
Copy link

I like this, it makes the example very clear.

I like this, it makes the example very clear.
emersion marked this conversation as resolved
Make migrate-logs exmaple more explicit
All checks were successful
builds.sr.ht Job completed
efe5221932
All checks were successful
builds.sr.ht Job completed
Required
Details
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u master:nickh-master
git switch nickh-master
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
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
emersion/soju!404
Reference in a new issue
emersion/soju
No description provided.
Delete branch "nickh/soju:master"

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?