Skip to content

Commit 14a5f1c

Browse files
committed
Issue #37: rename the --flag option to --preview as companion to --update
1 parent 45c09bb commit 14a5f1c

11 files changed

+166
-38
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,19 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
os: [ ubuntu-20.04, ubuntu-22.04 ]
15-
smalltalk: [ 3.6.6, 3.6.8, 3.7.0, 3.7.1 ]
14+
os: [ ubuntu-24.04, ubuntu-22.04 ]
15+
smalltalk: [ 3.6.6, 3.6.8, 3.7.0, 3.7.1, 3.7.2, 3.7.4.1 ]
1616
include:
17-
#- smalltalk: 3.7.1
18-
# os: macos-13
19-
#- smalltalk: 3.7.0
20-
# os: macos-13
21-
#- smalltalk: 3.7.0
22-
# os: macos-12
17+
- smalltalk: 3.7.4.1
18+
os: macos-14
19+
# - smalltalk: 3.7.2
20+
# os: macos-14
21+
# - smalltalk: 3.7.1
22+
# os: macos-14
2323
- smalltalk: 3.6.8
2424
os: macos-13
25-
- smalltalk: 3.6.8
26-
os: macos-12
2725
- smalltalk: 3.6.6
2826
os: macos-13
29-
- smalltalk: 3.6.6
30-
os: macos-12
3127
runs-on: ${{ matrix.os }}
3228
env:
3329
GS_VERS: ${{ matrix.smalltalk }}
@@ -52,7 +48,20 @@ jobs:
5248
echo "GSDEVKIT_STONES_ROOT=$GITHUB_WORKSPACE" >> "$GITHUB_ENV"
5349
5450
# clones superDoit and installs 3.7.0 to be used for .solo scripts
55-
$GSDEVKIT_STONES_ROOT/bin/install.sh
51+
case "$GS_VERS" in
52+
3.7.2)
53+
# use 3.7.1 for superDoit ...
54+
$GSDEVKIT_STONES_ROOT/bin/install.sh 3.7.1
55+
;;
56+
3.7.1)
57+
# use 3.7.1 ...
58+
$GSDEVKIT_STONES_ROOT/bin/install.sh $GS_VERS
59+
;;
60+
*)
61+
# 3.7.0 is the default
62+
$GSDEVKIT_STONES_ROOT/bin/install.sh
63+
;;
64+
esac
5665
5766
export SUPERDOIT_ROOT=$WORK_ROOT/superDoit
5867
echo "SUPERDOIT_ROOT=$WORK_ROOT/superDoit"
@@ -153,16 +162,7 @@ jobs:
153162
gslist.solo -lc
154163
deleteRegistry.solo `hostname` -f
155164
gslist.solo -l
156-
157165
shell: bash
158-
# - name: run rowanV3-alpha1 test
159-
# run: |
160-
# echo "CI=$CI"
161-
# $GSDEVKIT_STONES_ROOT/tests/test_rowanV3_alpha.sh
162-
# gslist.solo -lc
163-
# deleteRegistry.solo test_rowanV3 -f
164-
# gslist.solo -l
165-
# shell: bash
166166
- name: run tODE test
167167
run: |
168168
echo "CI=$CI"
@@ -171,12 +171,24 @@ jobs:
171171
deleteRegistry.solo devkit -f
172172
gslist.solo -l
173173
shell: bash
174+
- name: run rowanV3 test
175+
run: |
176+
echo "CI=$CI"
177+
if [ "$GS_VERS" = "3.7.2" ]; then
178+
$GSDEVKIT_STONES_ROOT/tests/test_rowanV3.sh
179+
gslist.solo -lc
180+
deleteRegistry.solo test_rowanV3 -f
181+
gslist.solo -l
182+
else
183+
echo "SKIP rowanV3 test for $GS_VERS";
184+
fi
185+
shell: bash
174186
slack-workflow-status:
175187
if: always()
176188
name: Post Workflow Status To Slack
177189
needs:
178190
- build
179-
runs-on: ubuntu-20.04
191+
runs-on: ubuntu-latest
180192
steps:
181193
- name: Slack Workflow Notification
182194
uses: Gamesight/slack-workflow-status@master

bin/cloneProjectsFromProjectSet.solo

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SuperDoitOptionalOptionWithRequiredArg long: 'registry' short: 'r'.
55
SuperDoitOptionalOptionWithRequiredArg long: 'remote' default: 'origin'.
66
SuperDoitRequiredOptionWithRequiredArg long: 'projectSet'.
77
SuperDoitOptionalOptionWithRequiredArg long: 'projectDirectory'.
8-
SuperDoitOptionalOptionWithNoArg long: 'flag'.
8+
SuperDoitOptionalOptionWithNoArg long: 'preview'.
99
SuperDoitOptionalOptionWithNoArg long: 'update'.
1010
}
1111
%
@@ -44,9 +44,9 @@ OPTIONS
4444
Path to directory where the projects will be cloned. If not
4545
specified the projectDirectory associated with the project set
4646
is used.
47-
--flag If present identify the list of projects that would be updated
48-
by the --update option. Useful to manually review the state of
49-
projects PRIOR to running the update command.
47+
--preview If present log whether or not a pull request is needed. Useful
48+
to manually review the state of projects PRIOR to doing a pull
49+
request.
5050
--update If present, a pull request will be issued for the origin remote
5151
to update the repository to the latest version of the branch
5252
available.
@@ -61,6 +61,7 @@ EXAMPLES
6161
$basename
6262
$basename --registry=bosch --projectSet=dev --remote=https Rowan \
6363
--projectDirectory=/home/dhenrich/bosch1/_exp_git
64+
$basename -r=bosch --projectSet=_stones Rowan --preview
6465
$basename -r=bosch --projectSet=_stones Rowan --update
6566
-----
6667
%
@@ -117,9 +118,9 @@ doit
117118
projectDir asFileReference ensureCreateDirectory.
118119
Rowan projectTools trace startTracing.
119120
self positionalArgs size = 0
120-
ifTrue: [ projectSet cloneOrUpdateProjectSet: projectDir remoteName: self remote flag: self flag pull: self update]
121+
ifTrue: [ projectSet cloneOrUpdateProjectSet: projectDir remoteName: self remote preview: self preview pull: self update]
121122
ifFalse: [
122123
self positionalArgs do: [:projectName |
123-
projectSet cloneOrUpdateProject: projectName remoteName: self remote in: projectDir flag: self flag pull: self update] ].
124+
projectSet cloneOrUpdateProject: projectName remoteName: self remote in: projectDir preview: self preview pull: self update] ].
124125
true
125126
%
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
installation
22
cloneOrUpdateProject: projectName in: gitRootPath
33
"Clone the named project into the gitRootPath directory using the information in the load spec for project. If the project
4-
has already been cloned, then checkout the revision specified in the load spec"
4+
has already been cloned, then checkout the revision specified in the load spec and display a message about whether or not a pull request is needed"
55

6-
self cloneOrUpdateProject: projectName remoteName: 'origin' in: gitRootPath pull: false
6+
self cloneOrUpdateProject: projectName remoteName: 'origin' in: gitRootPath preview: true pull: false
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
installation
22
cloneOrUpdateProject: projectName in: gitRootPath pull: pull
33
"Clone the named project into the gitRootPath directory using the information in the load spec for project. If the project
4-
has already been cloned, then checkout the revision specified in the load spec"
4+
has already been cloned, then checkout the revision specified in the load spec. If pull is true, then perform a pull request
5+
to update to the latest branch. If pull is false, print a message indicating whether or not a pull request is needed."
56

6-
self cloneOrUpdateProject: projectName remoteName: 'origin' in: gitRootPath pull: pull
7+
self cloneOrUpdateProject: projectName remoteName: 'origin' in: gitRootPath preview: pull not pull: pull
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
installation
22
cloneOrUpdateProject: projectName remoteName: remoteName in: gitRootPath
33
"Clone the named project into the gitRootPath directory using the information in the load spec for project. If the project
4-
has already been cloned, then checkout the revision specified in the load spec"
4+
has already been cloned, then checkout the revision specified in the load spec. Display a message about whether
5+
or not a pull request is needed"
56

6-
self cloneOrUpdateProject: projectName remoteName: remoteName in: gitRootPath pull: false
7+
self cloneOrUpdateProject: projectName remoteName: remoteName in: gitRootPath preview: true pull: false
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
installation
2+
cloneOrUpdateProject: projectName remoteName: remoteName in: gitRootPath preview: preview
3+
"Clone the named project into the gitRootPath directory using the information in the load spec for project. If the project
4+
has already been cloned, then checkout the revision specified in the load spec. If preview is true display a message
5+
about whether or not a pull request is needed"
6+
7+
self
8+
loneOrUpdateProject: projectName
9+
remoteName: remoteName
10+
in: gitRootPath
11+
preview: preview
12+
pull: false
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
installation
2+
cloneOrUpdateProject: projectName remoteName: remoteName in: gitRootPath preview: preview pull: pull
3+
"Clone the named project into the gitRootPath directory using the information in the load spec for project. If the project
4+
has already been cloned, then checkout the revision specified in the load spec. If preview is true display a message
5+
about whether or not a pull request is needed. If pull is true, perform the pull request."
6+
7+
| gitTool specDict gitUrls gitProjectRef gitUrl cloned |
8+
gitTool := Rowan gitTools.
9+
specDict := self loadSpecs at: projectName.
10+
gitUrls := specDict at: 'gitUrls'.
11+
gitUrl := gitUrls at: remoteName.
12+
gitProjectRef := gitRootPath asFileReference / projectName.
13+
cloned := false.
14+
gitProjectRef exists
15+
ifTrue: [
16+
(Rowan gitTools gitstatusIn: gitProjectRef fullName with: '--porcelain') isEmpty
17+
not
18+
ifTrue: [
19+
"the git repository has unsaved modifications, so abort the operation"
20+
self
21+
error:
22+
'There are unsaved changes in ' , gitProjectRef fullName printString
23+
, '. We cannot clone or update a repository with unsaved chnages' ] ]
24+
ifFalse: [
25+
| originArg |
26+
"GIT CLONE"
27+
originArg := ''.
28+
remoteName ~= 'origin'
29+
ifTrue: [ originArg := ' --origin ' , remoteName , ' ' ].
30+
gitTool gitcloneIn: gitRootPath with: originArg , gitUrl logging: true.
31+
cloned := true ].
32+
(specDict at: 'revision' ifAbsent: [ ])
33+
ifNotNil: [ :revision |
34+
Transcript
35+
cr;
36+
show: ' Set ' , projectName , ' revision to ' , revision.
37+
cloned
38+
ifTrue: [
39+
"GIT SWITCH"
40+
gitTool
41+
performGitCommand: 'switch'
42+
in: gitProjectRef fullName
43+
with: ' ' , remoteName , '/' , revision , ' -t -C ' , revision ]
44+
ifFalse: [
45+
preview ifTrue: [
46+
"GIT SWITCH
47+
GIT PULL"
48+
Transcript
49+
cr;
50+
show:
51+
' PREVIEW: PULL' , projectName , ' revision ' , revision , ' from remote ' , remoteName ].
52+
pull
53+
ifTrue: [
54+
"GIT SWITCH
55+
GIT PULL"
56+
gitTool
57+
performGitCommand: 'switch'
58+
in: gitProjectRef fullName
59+
with: ' ' , remoteName , '/' , revision , ' -t -C ' , revision.
60+
Transcript
61+
cr;
62+
show:
63+
' Pull ' , projectName , ' revision ' , revision , ' from remote ' , remoteName.
64+
gitTool
65+
gitpullIn: gitProjectRef fullName
66+
remote: remoteName
67+
branch: revision ] ] ].
68+
cloned
69+
ifTrue: [
70+
"GIT REMOTE ADD"
71+
(gitUrls keys reject: [ :each | each = remoteName ])
72+
do: [ :theRemote |
73+
self
74+
gitAddRemoteIn: gitProjectRef fullName
75+
remote: theRemote
76+
gitUrl: (gitUrls at: theRemote) ]. "GIT FETCH --all"
77+
Transcript
78+
cr;
79+
show: ' Fetch --all '.
80+
gitTool gitfetchIn: gitProjectRef with: ' --all' ]
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
installation
22
cloneOrUpdateProject: projectName remoteName: remoteName in: gitRootPath pull: pull
33
"Clone the named project into the gitRootPath directory using the information in the load spec for project. If the project
4-
has already been cloned, then checkout the revision specified in the load spec"
4+
has already been cloned, then checkout the revision specified in the load spec. If pull is true, the perform a pull request
5+
to update to the latest branch. If pull is false, print a message indicating whether or not a pull request is needed."
56

67
self
78
loneOrUpdateProject: projectName
89
remoteName: remoteName
910
in: gitRootPath
10-
flag: false
11+
preview: pull not
1112
pull: pull
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
installation
2+
cloneOrUpdateProjectSet: gitRootPath remoteName: remoteName preview: preview pull: pull
3+
"For each of the loadSpecs in the reciever, clone the speced project into the gitRootPath directory using the information
4+
in the load spec for project. If the project has already been cloned, then checkout the revision specified in the
5+
load spec. f preview is true display a message about whether or not a pull request is needed. If pull is true,
6+
perform the pull request."
7+
8+
self loadSpecs
9+
keysDo: [ :projectName | self cloneOrUpdateProject: projectName remoteName: remoteName in: gitRootPath preview: preview pull: pull ]
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
installation
22
cloneOrUpdateProjectSet: gitRootPath remoteName: remoteName pull: pull
3+
"For each of the loadSpecs in the reciever, clone the speced project into the gitRootPath directory using the information
4+
in the load spec for project. If the project has already been cloned, then checkout the revision specified in the
5+
load spec. f pull is false display a message about whether or not a pull request is needed. If pull is true,
6+
perform the pull request."
7+
38
self loadSpecs
4-
keysDo: [ :projectName | self cloneOrUpdateProject: projectName remoteName: remoteName in: gitRootPath pull: pull ]
9+
keysDo: [ :projectName | self cloneOrUpdateProject: projectName remoteName: remoteName in: gitRootPath preview: pull not pull: pull ]

0 commit comments

Comments
 (0)