Edgewall Software
Modify

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 wiki upgrade.

API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

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 Ryan J Ollos, 5 years ago

Component: generalwiki system
Description: modified (diff)
Keywords: trac-admin added

comment:2 by Ryan J Ollos, 5 years ago

[16472#file8] changed load_pages to not echo the page imported, but load_pages is called by _load_or_replace, which is called for wiki load and wiki 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.

comment:3 by Ryan J Ollos, 5 years ago

Release Notes: modified (diff)

comment:4 by Ryan J Ollos, 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?

comment:5 by Jun Omae, 5 years ago

Ah, that means wiki replace function doesn't work on MySQL since [8956] (0.12dev, #8861).

I think we could use WikiPage class rather than executing directly SQL in import_page(). It would be simple and prevent such a bug.

in reply to:  5 comment:6 by Ryan J Ollos, 5 years ago

Replying to Jun Omae:

I think we could use WikiPage class rather than executing directly SQL in import_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 Ryan J Ollos, 5 years ago

Milestone: 1.4.21.4.3

comment:8 by Ryan J Ollos, 4 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 1.4-stable in r17468, r17470, merged to trunk in r17469, r17471.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.