Opened 5 years ago
Closed 4 years ago
#13299 closed enhancement (fixed)
Make wiki upgrade less verbose
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.4.3 |
Component: | wiki system | Version: | |
Severity: | normal | Keywords: | trac-admin |
Cc: | Branch: | ||
Release Notes: |
Removed print to console of upgraded wiki page names on TracAdmin |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Example of upgrading a 1.2 environment to 1.4:
$ trac-admin env1 wiki upgrade TracAdmin is already up to date TracCgi is already up to date TracBatchModify is already up to date TracBackup is already up to date TicketQuery is already up to date InterMapTxt already exists WikiRestructuredTextLinks is already up to date TracSupport is already up to date TracRss is already up to date RecentChanges is already up to date TitleIndex is already up to date
I don't think the information is useful to administrators. Instead, we could log the output at INFO level, like was done in #12966, and print
$ trac-admin env1 wiki upgrade Upgrade done: 14 pages upgraded.
Then, it will be more concise, like the environment upgrade:
$ trac-admin env1 upgrade Upgrade done. You may want to upgrade the Trac documentation now by running: trac-admin "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/env1" wiki upgrade
Attachments (0)
Change History (8)
comment:1 by , 5 years ago
Component: | general → wiki system |
---|---|
Description: | modified (diff) |
Keywords: | trac-admin added |
comment:2 by , 5 years ago
comment:3 by , 5 years ago
Release Notes: | modified (diff) |
---|
comment:4 by , 5 years ago
Proposed changes in log:rjollos.git:t13299_less_verbose_wiki_upgrade. I added TracAdmin wiki
test coverage and tried to make the console message output consistent.
The added test coverage uncovered incompatible SQL for MySQL:
FAIL: test_wiki_replace (trac.wiki.tests.admin.TracAdminTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "trac\wiki\tests\admin.py", line 514, in test_wiki_replace self.assertEqual(0, rv, output) AssertionError: InternalError: (1093, u"You can't specify target table 'wiki' for update in FROM clause")
[dd989e219/rjollos.git] fixes the incompatible syntax on MySQL. Further, the 1 + COALESCE(max(version), 0)
in the INSERT
statement could be replaced with a query arg max_version + 1
, but I didn't make that change yet. I assume either way is fine, but maybe the latter is better for code clarity.
Is it a good way to fix the issue, or is there a better way?
follow-up: 6 comment:5 by , 5 years ago
comment:6 by , 5 years ago
Replying to Jun Omae:
I think we could use
WikiPage
class rather than executing directly SQL inimport_page()
. It would be simple and prevent such a bug.
Good point! Another side effect, wiki change listeners will be called when using WikiPage
class.
Added more changes to log:rjollos.git:t13299_less_verbose_wiki_upgrade.
I will add more test coverage for the WikiPage
model, and WikiAdmin.{load_pages, import_page, export_page}
.
Moving to 1.4.3 due to scope of changes. Created #13315 for fixing comment:4 on 1.0-stable. I'll be looking to make the smallest change possible to fix the issue on 1.0-stable. If 1.0-stable is still important for you and you want to do more, feel free to take ownership of the ticket.
comment:7 by , 5 years ago
Milestone: | 1.4.2 → 1.4.3 |
---|
[16472#file8] changed
load_pages
to not echo the page imported, butload_pages
is called by_load_or_replace
, which is called forwiki load
andwiki replace
, so the loaded or replaced page names are no longer printed to the terminal.I'll fix that issue and add test coverage for the
trac-admin wiki
commands.