Updates

User in Changes Report

After upgrading this wiki to the latest code, the changes report displays the user as:

PUUser [1234] name: 'jborden'
While this only affects logged-in users who view the changes, it is annoying.

When researching this, I found:

  • The message PRContext(Object)>>#magritteDescriptionBuilders is missing QCDescriptionBuilderContainer (from the Magritte-Model package). This is also missing in an older image
  • This area also involves some internal code: Pragma allNamed: #magritteBuilder from: PRContext to: Object - For working and non-working, this returns an empty array.
  • When I was looking into PRHistoryView>>buildReport in the debugger, inspecting self buildDescription raised an error for kernel sent to nil

One option that resolves the issue:

PUUser>>#printOn: aStream
	"Needed so the changes view displays without 'PUUser[1234..] name: admin'."

	aStream nextPutAll: self name

This seems like a better solution since there are many problems. One is Pier does not yet work on Pharo 9 (first issue is in Pillar). I also noticed problems running Exercism in the new version too (seems to work best on Pharo 8).

More information on the Pier changes feature can be found on Complete Task in List of Changes.

Posted by John Borden at 28 August 2021, 5:11 pm link

Pier on Docker

This uses the Buenos Aires Smalltalk group's docker work and here-docs (just create the files with the text between the greater-thans and the closing bang if your shell does not support it):

0 Johns-MacBook-Pro$ mkdir pharo-pier; cd pharo-pier
0 Johns-MacBook-Pro$ cat > start.st <<-!
Transcript show: 'Pier should be running in the background'.

"Suspend UI process, not needed on headless"
(Process allSubInstances reject: #isTerminated)
	detect: [ :process | process name includesSubstring: 'UI Process' ]
	ifFound: [ :process | process suspend ].
Processor activeProcess suspend.
!
0 Johns-MacBook-Pro$ cat > load-project.st <<-!
Metacello new
  baseline:'PierCore';
  repository: 'github://Pier-CMS/Pier3:main/repository';
  onConflictUseLoaded;
  load.
!
0 Johns-MacBook-Pro$ cat > Dockerfile <<-!
# Use the images generated from this repository as base
FROM basmalltalk/pharo:8.0-image

# Put the load-project.st script in the docker image and then load the project
COPY load-project.st ./
RUN pharo Pharo.image load-project.st --save --quit

# Put start.st in the docker image and configure the docker image to start it
COPY start.st ./
CMD [ "pharo", "Pharo.image", "start.st" ]
!
0 Johns-MacBook-Pro$ docker build . -t pharo-pier                                       
0 Johns-MacBook-Pro$ docker run --interactive --tty --rm --publish 8080:8080 pharo-pier

The last command should display the transcript message of pier running. If one connects to http://localhost:8080/pier the basic pier in a web browser. By changing load-project.st with another pier project or branch then a larger project can be tested.

Posted by John Borden at 14 July 2021, 3:06 pm link

Workout Export

The process of upgrading the underlying server for this site has quite a few manual tasks, one being exporting any PierWorkout. When running PRKernelCreatorForPier, any PRWorkoutLog has the workouts exported as an array of PRExerciseEntries, like:

structure workouts: #(5 sets on 1 June 2015 6 sets on 3 June 2015

Initially I had planned to build a parser to use a state machine and read in each entry building up a workout. Then I saw it would be easier to modify how it is printed in:

PRWorkout>>printOn:
PRExerciseEntry>>>>pipeFormattedPrintOn:

These now display a workout with the same format used for testing in PRWorkoutTest. Modifying PRWorkoutLog>>workouts: as:

	workouts := (aCollectionOfPRWorkouts asOrderedCollection
		collectAll: [ :e |
			e isString
				ifTrue: [ self class workoutsBasedOnString: e ]
				ifFalse: [ OrderedCollection with: e ] ])
		sorted: [ :a :b | a date < b date ]
Posted by John Borden at 11 June 2021, 12:26 pm link

Rename Banch to Main

While working through an user-add issue in Pier, I decided to rename the primary branch from master to main. Personally I don't have strong feelings concerning the name, however if it makes others feel more comfortable contributing to a project that doesn't conjure up master/slave images, then it is worth the effort.

One nice aspect of Pier is that it allows pages to be embedded in other pages, which reduces the number of updates. An example is:

The Loading with Metacello core version 3.2 can be loaded from GitHub using Metacello:

Metacello new
 baseline:'PierCore';
 repository: 'github://Pier-CMS/Pier3:main/repository';
 onConflictUseLoaded;
 load.

The #onConflict... code is due to a Grease version mismatch between Seaside and Magritte.

For the full install with all the addons, it can be loaded with:

Metacello new
 baseline:'PierAddons';
 repository: 'github://Pier-CMS/Pier3:main/repository';
 onConflictUseLoaded;
 load.

The PierToDo code depends on the add-ons, it can be loaded with:

Metacello new
 baseline:'PierTodo';
 repository: 'github://Pier-CMS/Pier3:main/repository';
 onConflictUseLoaded;
 load.

Posted by John Borden at 13 May 2021, 3:30 am link

Displaying Variables in Pier

If one wants to list ksh variables in Pier (or any dollar-bracket text), then there can be issues if the line is not preformatted. This can be saved in an editor:

text \${bracket-text} other
text $\{bracket-text} other
text \$\{bracket-text} other

They are each displayed as:

text ${bracket-text} other

However if one removes the back-slashes and saves the text (but not as a line starting with an equal sign to make it preformatted) then it generates a walkback:

Seaside Walkback - PRSyntaxError Pillar does not support this tag
This is only a problem for users logged in and using Pier-Addons. If basic Pier is used (without loading the enhanced editor in PierAddons) the problem text causes it to display the editor with the error:

Contents: Invalid input given

For blog comments and other text fields, the enhanced editor isn't opened.

It seemed like fixing this could be resolved by catching the exception and adding a backslash before the dollar sign. This can be changed in PRWysiwygEditor>>#document, however it causes the same invalid input error, but at least it does not open a walkback. A long-term fix for this would likely be replacing the YUI editor.

Posted by John Borden at 10 April 2021, 3:28 pm link
<< 1 2 3 4 5 6 7 8 9 10 >>