[Vm-dev] VM Maker: VMMakerUI-mt.43.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Aug 4 16:15:24 UTC 2021


Marcel Taeumel uploaded a new version of VMMakerUI to project VM Maker:
http://source.squeak.org/VMMaker/VMMakerUI-mt.43.mcz

==================== Summary ====================

Name: VMMakerUI-mt.43
Author: mt
Time: 4 August 2021, 6:15:23.154699 pm
UUID: 369857e6-00b7-ac45-917c-d31bf0b7c6c0
Ancestors: VMMakerUI-eem.42

Adds badges for GitHub workflows. PNG badges via shields.io ... needs displayed action name instead of file name. Might break easily. Hmm... Also, timestamp access parses actual HTML file. API access would need extra key. So ...

Fixes minor regression from previous version, which did never set oldVersionInfo to "nil" so that the "*added*" label was not used for new packages. And not-updated packages spoiled the list.

=============== Diff against VMMakerUI-eem.42 ===============

Item was removed:
- ----- Method: TheWorldMainDockingBar>>osvm_AppVeyor_statusBadgeUrl (in category '*VMMakerUI-updater') -----
- osvm_AppVeyor_statusBadgeUrl
- 
- 	^ 'https://ci.appveyor.com/api/projects/status/ecrpcrqt844n8lkm/branch/Cog'!

Item was removed:
- ----- Method: TheWorldMainDockingBar>>osvm_AppVeyor_statusPageUrl (in category '*VMMakerUI-updater') -----
- osvm_AppVeyor_statusPageUrl
- 
- 	^ 'https://ci.appveyor.com/project/OpenSmalltalk/vm/branch/Cog'!

Item was removed:
- ----- Method: TheWorldMainDockingBar>>osvm_AppVeyor_statusTimestamp (in category '*VMMakerUI-updater') -----
- osvm_AppVeyor_statusTimestamp
- 
- 	| url stamp  dateAndTime |
- 	url := 'https://ci.appveyor.com/api/projects/OpenSmalltalk/vm/branch/Cog'.
- 	stamp := ((WebUtils jsonDecode: (WebClient httpGet: url) content readStream) at: 'build') at: 'finished'.
- 	stamp ifEmpty: [^ stamp].
- 	dateAndTime := DateAndTime readFrom: stamp readStream.
- 	^ String streamContents: [:s |
- 		dateAndTime asDate = Date today
- 			ifTrue: [s nextPutAll: 'Today' translated, ',']
- 			ifFalse: [dateAndTime asDate = Date yesterday
- 				ifTrue: [s nextPutAll: 'Yesterday' translated, ',']
- 				ifFalse: [dateAndTime printYMDOn: s]].
- 		s space.
- 		dateAndTime printHMSOn: s]!

Item was added:
+ ----- Method: TheWorldMainDockingBar>>osvm_GitHubActions_statusBadgeUrl: (in category '*VMMakerUI-updater') -----
+ osvm_GitHubActions_statusBadgeUrl: workflowName
+ 
+ 	| id |
+ 	id := workflowName encodeForHTTP.
+ 	^ 'https://raster.shields.io/github/workflow/status/OpenSmalltalk/opensmalltalk-vm/{1}?style=flat&logo=github'
+ 		format: {id}!

Item was added:
+ ----- Method: TheWorldMainDockingBar>>osvm_GitHubActions_statusPageUrl: (in category '*VMMakerUI-updater') -----
+ osvm_GitHubActions_statusPageUrl: workflow
+ 
+ 	^ 'https://github.com/OpenSmalltalk/opensmalltalk-vm/actions/workflows/{1}.yml'
+ 		format: {workflow}!

Item was added:
+ ----- Method: TheWorldMainDockingBar>>osvm_GitHubActions_statusTimestamp: (in category '*VMMakerUI-updater') -----
+ osvm_GitHubActions_statusTimestamp: workflow
+ 	"Slow. Fetch HTML page, extract first occurrence of
+ 		... <time-ago datetime='2021-08-04T14:24:20Z' ... "
+ 
+ 	| statusPage begin end dateAndTime |
+ 	statusPage := (WebClient httpGet: (self osvm_GitHubActions_statusPageUrl: workflow)) content.
+ 	begin := statusPage findString: 'datetime' startingAt: 100000. "Skip the first X bytes decoration."
+ 	end := statusPage findString: 'Z' startingAt: begin.
+ 	dateAndTime := DateAndTime readFrom: (statusPage copyFrom: begin + 10 to: end) readStream.
+ 	^ String streamContents: [:s |
+ 		dateAndTime asDate = Date today
+ 			ifTrue: [s nextPutAll: 'Today' translated, ',']
+ 			ifFalse: [dateAndTime asDate = Date yesterday
+ 				ifTrue: [s nextPutAll: 'Yesterday' translated, ',']
+ 				ifFalse: [dateAndTime printYMDOn: s]].
+ 		s space.
+ 		dateAndTime printHMSOn: s]!

Item was removed:
- ----- Method: TheWorldMainDockingBar>>osvm_TravisCI_statusBadgeUrl (in category '*VMMakerUI-updater') -----
- osvm_TravisCI_statusBadgeUrl
- 
- 	^ 'https://api.travis-ci.com/OpenSmalltalk/opensmalltalk-vm.png?branch=Cog'!

Item was removed:
- ----- Method: TheWorldMainDockingBar>>osvm_TravisCI_statusPageUrl (in category '*VMMakerUI-updater') -----
- osvm_TravisCI_statusPageUrl
- 
- 	^ 'https://travis-ci.com/OpenSmalltalk/opensmalltalk-vm'!

Item was removed:
- ----- Method: TheWorldMainDockingBar>>osvm_TravisCI_statusTimestamp (in category '*VMMakerUI-updater') -----
- osvm_TravisCI_statusTimestamp
- 
- 	| stamp " 'Mon, 05 Jul 2021 17:52:11 GMT' " dateAndTime |
- 	stamp := (WebClient httpGet: self osvm_TravisCI_statusBadgeUrl) headerAt: 'last-modified'.
- 	stamp ifEmpty: [^ stamp].
- 	dateAndTime := DateAndTime readFrom: (((stamp allButFirst: 4) allButLast: 4), ' Z') readStream.
- 	^ String streamContents: [:s |
- 		dateAndTime asDate = Date today
- 			ifTrue: [s nextPutAll: 'Today' translated, ',']
- 			ifFalse: [dateAndTime asDate = Date yesterday
- 				ifTrue: [s nextPutAll: 'Yesterday' translated, ',']
- 				ifFalse: [dateAndTime printYMDOn: s]].
- 		s space.
- 		dateAndTime printHMSOn: s]!

Item was changed:
  ----- Method: TheWorldMainDockingBar>>updateVMMaker (in category '*VMMakerUI-updater') -----
  updateVMMaker
  	<updater: 'Update VMMaker'>
  
  	| updater history message |
  	updater := MCMcmUpdater
  		updateMapNamed: 'update.oscog'
  		repository: 'http://source.squeak.org/VMMaker'.
  	updater lastUpdateMap ifEmpty: [
  		"If this is the first time that you use the updater, start at 5.mcm to avoid loading old code."
  		updater lastUpdateMap at: updater repository put: 5].
  
  	history := updater dependentPackages
+ 		collect: [:package | package name -> (package workingCopy ancestors
+ 			"N.B. the first version in a package's history will have empty ancestors."
+ 			ifEmpty: [nil] ifNotEmpty: [:ancestors| ancestors first])]
- 		collect: [:package | package name -> (package workingCopy ancestors ifNotEmpty: [:ancestors| ancestors first])]
  		as: OrderedDictionary.
  
  	updater doUpdate: false.
  	
  	"Set update history to the packages that actually changed."
  	updater dependentPackages do: [:package | | oldVersionInfo newVersionInfo |
  		oldVersionInfo := history at: package name ifAbsent: [].
  		newVersionInfo := package workingCopy ancestors first.
+ 		(oldVersionInfo ifNil: [0] ifNotNil: [oldVersionInfo versionNumber]) < newVersionInfo versionNumber
- 		"N.B. the first version in a package's history will have empty ancestors.
- 		 oldVersionInfo basicSize = 0 is true for these as well as nil."
- 		(oldVersionInfo basicSize = 0 ifTrue: [0] ifFalse: [oldVersionInfo versionNumber]) < newVersionInfo versionNumber
  			ifTrue: [history at: package name put: {oldVersionInfo. newVersionInfo}]
  			ifFalse: [history removeKey: package name]].
  	
  	"Prepare message, including the update history and OSVM ci badges."
  	message := String streamContents: [:s |
  		s nextPutAll: 'VMMaker update succesful.<br><br>'.
  		history
  			ifEmpty: [s nextPutAll: 'All packages were already up-to-date.']
  			ifNotEmpty: [s nextPutAll: 'Updated packages:'].
  		history keysAndValuesDo: [:packageName :updateInfo |
  			s nextPutAll: '<br> - '.
  			s nextPutAll: packageName; space.
  			updateInfo isArray
  				ifFalse: [s nextPutAll: '*removed*' translated]
  				ifTrue: [
  					updateInfo first
  						ifNil: [s nextPutAll: '*added*' translated]
+ 						ifNotNil: [s print: updateInfo first versionNumber].
- 						ifNotNil: [updateInfo first isArray ifFalse: [s print: updateInfo first versionNumber]].
  					s nextPutAll: ' -> <b>'.
  					s print: updateInfo second versionNumber.
  					s nextPutAll: '</b>']].
  		s nextPutAll: ('<br><br>Url: <a href="{1}">{1}</a>' format: {updater repository}).
  		s nextPutAll: '<br>Map: '; print: updater updateMapName.
+ 
+ 		s nextPutAll: '<br>'.
+ 		#('macOS' macos 'Build for macOS'
+ 		'Windows' win 'Build for Windows'
+ 		'Linux (x86)' linux 'Build for Linux (x86)'
+ 		'Linux (ARM)' 'linux-arm' 'Build for Linux (ARM)')
+ 			groupsDo: [:label :workflow :workflowName |
+ 				s nextPutAll: ('<br>{1} status: <a href="{2}"><img src="{3}" /> {4}</a>'
+ 					format: {
+ 						label.
+ 						self osvm_GitHubActions_statusPageUrl: workflow.
+ 						self osvm_GitHubActions_statusBadgeUrl: workflowName.
+ 						self osvm_GitHubActions_statusTimestamp: workflow})].
- 	
- 		s nextPutAll: ('<br><br>TravisCI status: <a href="{1}"><img src="{2}" /> {3}</a>'
- 			format: {
- 				self osvm_TravisCI_statusPageUrl.
- 				self osvm_TravisCI_statusBadgeUrl.
- 				self osvm_TravisCI_statusTimestamp}).
- 		s nextPutAll: ('<br>AppVeyor status: <a href="{1}"><img src="{2}" /> {3}</a>'
- 			format: {
- 				self osvm_AppVeyor_statusPageUrl.
- 				self osvm_AppVeyor_statusBadgeUrl.
- 				self osvm_AppVeyor_statusTimestamp}).
  		
  		s nextPutAll: ('<br><br>NOTE THAT updated platform sources might be available, too:<br> -> <a href="{1}">{1}</a>' format: {'https://github.com/OpenSmalltalk/opensmalltalk-vm'}).
  			
  			].
  	self inform: message asTextFromHtml.!



More information about the Vm-dev mailing list