[squeak-dev] The Trunk: System-mt.1248.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Nov 22 10:13:44 UTC 2021


Yes. The biggest issue is, though, that we have no simple way to get the DateAndTime of the latest build job. I have to parse the HTML page ... -.-"

Setting up an account-specific API key seems not worth the effort for such a little piece of information.

In TravisCI, that info was free like the badge.

Best,
Marcel
Am 22.11.2021 11:08:09 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
Ah. You did not use the badge URL from GitHub itself <https://github.com/squeak-smalltalk/squeak-app/actions/workflows/bundle.yml/badge.svg?branch=squeak-trunk [https://github.com/squeak-smalltalk/squeak-app/actions/workflows/bundle.yml/badge.svg?branch=squeak-trunk]> because they only offer SVGs as of today. Yeah, maybe we should have an SVG solution right in the Trunk at someday... :-)

Best,
Christoph
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Montag, 22. November 2021 10:12:00
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: System-mt.1248.mcz
 
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1248.mcz [http://source.squeak.org/trunk/System-mt.1248.mcz]

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

Name: System-mt.1248
Author: mt
Time: 22 November 2021, 10:11:55.950785 am
UUID: 26002484-3fff-e74e-8a15-9cf025fe7395
Ancestors: System-mt.1247

Fixes CI status in update dialog.

=============== Diff against System-mt.1247 ===============

Item was added:
+ ----- Method: SystemVersion>>ciBranch (in category 'continuous integration') -----
+ ciBranch
+        "Convert the receiver into the corresponding branch name on github.com/squeak-smalltalk/squeak-app."
+
+        | branch |
+        branch := 'squeak-{1}{2}{3}' format: {
+                self isRelease ifTrue: [self majorVersionNumber] ifFalse: [''].
+                self isRelease ifTrue: ['.'] ifFalse: ['trunk'].
+                self isRelease ifTrue: [self minorVersionNumber] ifFalse: [''] }.
+
+        ^ branch!

Item was changed:
  ----- Method: SystemVersion>>ciStatusBadgeUrl (in category 'continuous integration') -----
  ciStatusBadgeUrl
+        "shields.io needs a workflow's descriptive name, not the name of the .yml file."
-
-        | branch |
-        branch := 'squeak-{1}{2}{3}' format: {
-                self isRelease ifTrue: [self majorVersionNumber] ifFalse: [''].
-                self isRelease ifTrue: ['.'] ifFalse: ['trunk'].
-                self isRelease ifTrue: [self minorVersionNumber] ifFalse: [''] }.
        
+        ^ 'https://raster.shields.io/github/workflow/status/squeak-smalltalk/squeak-app/{1}/{2}?style=flat&logo=github [https://raster.shields.io/github/workflow/status/squeak-smalltalk/squeak-app/{1}/{2}?style=flat&logo=github]'
+                format: {self ciWorkflowName encodeForHTTP. self ciBranch}!
-        ^ 'https://api.travis-ci.com/squeak-smalltalk/squeak-app.png?branch= [https://api.travis-ci.com/squeak-smalltalk/squeak-app.png?branch=]', branch!

Item was changed:
  ----- Method: SystemVersion>>ciStatusPageUrl (in category 'continuous integration') -----
  ciStatusPageUrl
-        "In a release image, let the user see the overview of branches to choose from. I am not aware of a permanent link for a specific branch. In a trunk image, just let Travis report the state of the main branch, which is usually for trunk builds."
 
+        ^ 'https://github.com/squeak-smalltalk/squeak-app/actions/workflows/{1}?query=branch%3A{2}+is%3Acompleted+event%3Aschedule [https://github.com/squeak-smalltalk/squeak-app/actions/workflows/{1}?query=branch%3A{2}+is%3Acompleted+event%3Aschedule]'
+                format: {self ciWorkflow. self ciBranch}!
-        ^ 'http://travis-ci.com/squeak-smalltalk/squeak-app{1} [http://travis-ci.com/squeak-smalltalk/squeak-app{1}]' format: {
-                self isRelease ifFalse: [''] ifTrue: ['/branches'] }!

Item was changed:
  ----- Method: SystemVersion>>ciStatusTimestamp (in category 'continuous integration') -----
  ciStatusTimestamp
+        "Slow. Fetch HTML page, extract first occurrence of
+                ... <time-ago datetime='2021-08-04T14:24:20Z' ... "
 
+        | statusPage begin end dateAndTime |
+        statusPage := (WebClient httpGet: self ciStatusPageUrl) 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.
-        | stamp " 'Mon, 05 Jul 2021 17:52:11 GMT' " dateAndTime |
-        stamp := (WebClient httpGet: self ciStatusBadgeUrl) 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 added:
+ ----- Method: SystemVersion>>ciWorkflow (in category 'continuous integration') -----
+ ciWorkflow
+        "See https://github.com/squeak-smalltalk/squeak-app/tree/squeak-trunk/.github/workflows [https://github.com/squeak-smalltalk/squeak-app/tree/squeak-trunk/.github/workflows]"
+       
+        ^ 'bundle.yml'!

Item was added:
+ ----- Method: SystemVersion>>ciWorkflowName (in category 'continuous integration') -----
+ ciWorkflowName
+        "See 'name' in #ciWorkflow .yml file. Case sensitive."
+       
+        ^ 'Bundle'!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211122/ec032b1f/attachment-0001.html>


More information about the Squeak-dev mailing list