Software-Entwicklungsprozess mit Git und API MasterSoftware-Entwicklungsprozess mit Git und API Master
SoftwarearchitektAdam [email protected]
Konferenz:
Oracle Forms Days 2018Oracle Customer Visit Center Berlin Behrenstraße 4210117 Berlin
2
Adam LukaszewskiSoftwarearchitekt
AdamLukaszewski
www.creative-doing.de
adamlukaszewski
3
Agile Softwareentwicklung
● “Die einzige Konstante ist die Veränderung!”
● Flexibilität durch inkrementelle und iterative Bereitstellung von Software
● Gemeinsames Erarbeiten von Produktinkrementen
● Agile Entwicklung setzt auch bestimmte Anforderungen an die
○ Organisation ... ○ das Team … ○ und das Toolset voraus.
● Git schafft die notwendigen Freiheitsgrade, die der Entwicklung von Software inhärent sind → Mehr Agilität
powered by
4
Goo
d ol
d (fa
st) O
racl
e Fo
rms.
..
https://pixabay.com/photo-2271609/4
5
Git Workflow - Master-Branch (Production)
master
Version 1.0 Version 2.0
Master = Production!!!
Bereitstellung von Softwareversionen (Releases). Releases bestehen aus unterschiedlichen Bug-fixes, Change-Requests und Features.
Revisionsstände werden im Git mit einem Release-Tag, bspw. v1.1.2, festgeschrieben.
6
Git Workflow - CR_1 - Branch
master
Version 1.0 Version 2.0
CR_1
Die Entwicklung passiert in einem oder mehreren separaten Branches (parallel).
Einzelne Entwicklungsstände werden durch Commits bereitgestellt.
7
Git Workflow - CR_1 - Branch
master
Version 1.0 Version 2.0
CR_1
Zusammenführen der Produktiv-version in den Develop-Branch!
8
Git Workflow - BUG_1 -Branch
master
Version 1.0 Version 2.0
CR_1
BUG_1
Neue Branch für die Entwicklung eines Bug-Fixes.
Wie kann nun der fertige Entwicklungsstand von BUG_1 und CR_1 in den master überführt werden?
9
Git Workflow - Release-Branch
master
Version 1.0 Version 2.0
CR_1
BUG_1
release (2.0)
Erstellung eines Release- Branches, um die Version 2.0 vorzubereiten.
Zusammenführen (mergen) von fertigen Bug-fixes, Change-Requests, etc.) in den Release-Branch.
Zusammenführen (mergen) von Release-Branch und Master-Branch (entspricht einem Deployment)!
10
Master = Production
Only File-Based Development!
“Die Wahrheit steckt im Git”
10
11https://pixabay.com/photo-384083/
Bloß keine Merges im Quellcode! Diese bereiten nur Kopfschmerzen! Solche Zustände dürfen erst gar nicht auftreten!
Aber… aber! Keine Angst vor Merge-Konflikten! Ich zeige dir, wie man diese spielerisch auflöst!
11
12https://flic.kr/p/9ju8ej
It’s Coding Time...
12
13
Git Merges part 1 of 3 (plain) - CR_1
123456789
10111213141516171819
# .. we create a change request branch$ git branch DOAG_CR_1 # .. and we switch to the branch$ git checkout DOAG_CR_1Switched to branch 'DOAG_CR_1'
# .. We change a file$ echo "Some changes in a file" >> db/fnd/src/main/app/packages/fnd_session_pkg.pkb
# .. and add it$ git add .
# .. and commit it$ git commit -m "CR_1: We made some nice changes"
# .. lets check what we have changes in the cr branch$ git difftool master
14
123456789
10111213141516
# .. lets create a new branch and switch to it$ git checkout -b BUG_1Switched to a new branch 'BUG_1'
# .. we change the same file$ echo "Bug beseitigt" >> db/fnd/src/main/app/packages/fnd_session_pkg.pkb
# .. and add it$ git add .
# .. and commit it$ git commit -m "BUG_1: We made some nice changes"
# .. lets check what we have changes in the cr branch$ git difftool master
Git Merges part 2 of 3 (plain) - BUG_1
15
Git Merges part 3 of 3 (plain) - Release
123456789
101112131415161718192021
# .. lets create a new release branch and switch to it$ git checkout -b AV_3_0Switched to a new branch 'AV_3_0'
# .. we package (merge) the CR_1 into the release AV_3_0$ git merge DOAG_CR_1Fast-forward db/fnd/src/main/app/packages/fnd_session_pkg.pkb | 1 +
# .. we package (merge) the BUG_1 into the release AV_3_0$ git merge BUG_1Auto-merging db/fnd/src/main/app/packages/fnd_session_pkg.pkbCONFLICT (content): Merge conflict in db/fnd/src/main/app/packages/fnd_session_pkg.pkb
# .. lets merge BUG_1 and CR_1$ git mergetoolMerging:db/fnd/src/main/app/packages/fnd_session_pkg.pkb
# .. and commit the merge $ git commit
16https://pixabay.com/photo-384083/
Und was ist mit Forms?! Bleiben wir lieber bei unseren starren Entwicklungsprozessen. Forms ist nicht für die agile Softwareentwicklung mit Git gemacht!
Aber… aber! Da kennst du wohl noch nicht den Forms API Master und die Möglichkeiten von Git!
17
Das Supertrio für den Forms-Entwickler von Morgen
https://pixabay.com/photo-2570250/https://pixabay.com/photo-2570250/
18
Forms API Master
● Nützliche Funktionen für die Entwicklung von Oracle Forms und Reports Modulen○ Compare-Modus (auch aus der
Console)○ Merge-Modus (auch aus der
Console)○ Modulübergreifende Suche○ “Großflächige Anpassung” von
Modulen mit Skriptsprache im Batch○ Batch-Kompilierung○ Batch-Converter
● Relativ kostengünstig für die zeitliche Ersparnis und Effizienzsteigerung
● Keine Subskription, keine Supportkosten!
19https://pixabay.com/photo-2570250/
Let’s make Forms Development agile!
20
Forms API Master Diff- und Merge-Tool
123456789
1011121314151617181920
adam.Lukaszewski@DEPC00108 MINGW64 ~$ vi .gitconfig
...
[difftool] prompt = true
[difftool "fapi"] cmd = fapi_diff.sh $LOCAL $REMOTE
[mergetool] prompt = true keepBackup = false
[mergetool "fapi"] cmd = fapi_merge.sh $BASE $LOCAL $REMOTE
Zentrale Konfigurationsdatei von Git
Bekanntgabe eines neuen Diff-Tools. Kann mit git difftool --tool=fapi *.fmb aufgerufen werden.
Übergabe an Shell-Skript zur weiteren Verarbeitung an Win(-doof) CMD. $LOCAL und $REMOTE werden durch Git gesetzt.
Analog die Merge-Einstellung zum Diff-Tool.
21
fapi_diff.sh und fapi_merge.sh
123456789
1011121314151617181920
adam.Lukaszewski@DEPC00108 MINGW64 ~$ vi ./bin/fapi_diff.sh
#!/bin/shLOCAL=$(echo $1 | sed 's|/|\\|g')REMOTE=$(echo $2 | sed 's|/|\\|g')cmd.exe /C "FapiMaster.exe /COMPARE /MODULE1=$LOCAL /MODULE2=$REMOTE"
adam.Lukaszewski@DEPC00108 MINGW64 ~$ vi ./bin/fapi_merge.sh
#!/bin/shMODULEBASE=$(echo $1 | sed 's|/|\\|g')MODULE1=$(echo $2 | sed 's|/|\\|g')MODULE2=$(echo $3 | sed 's|/|\\|g')cmd.exe /C "FapiMaster.exe /COMPARE /MODULEBASE=$MODULEBASE /MODULE1=$MODULE1 /MODULE2=$MODULE2"
Anpassen der Dateipfade: “\” vs “/”
Call des Forms API Masters (CMD)FapiMaster.exe muss im PATH (Env) enthalten sein, ggf. “hart” referenzieren
22
Forms, A
PI
Master a
nd Git
In Action
23
Git Merges part 1 of 3 (FRM) - CR_1
123456789
101112131415
# .. And we switch to the branch$ git checkout DOAG_CR_1Switched to branch 'DOAG_CR_1'
# .. we change a forms module in our forms builder
# .. and add it$ git add .
# .. and commit it$ git commit -m "CR_1: We made some nice changes Forms changes"
# .. lets check what we have changes in the cr branch$ git difftool --tool=fapi master *.fmb
24
Git Merges part 2 of 3 (FRM) - BUG_1
123456789
101112131415
# .. And we switch to the branch$ git checkout BUG_1Switched to branch BUG_1
# .. we change a forms module in our forms builder
# .. and add it$ git add .
# .. and commit it$ git commit -m "BUG_1: We made some nice changes Forms changes"
# .. lets check what we have changes in the cr branch$ git difftool --tool=fapi master *.fmb
25
Git Merges part 3 of 3 (FRM) - Release
123456789
101112131415171819202122
# .. lets create a new release branch and switch to it$ git checkout AV_3_0Switched to a new branch 'AV_3_0'
# .. we package (merge) the CR_1 into the release AV_3_0$ git merge CR_1Merge made by the 'recursive' strategy. ui_forms/mv_anzmd.fmb | Bin 1409024 -> 1114112 bytes
# .. we package (merge) the BUG_1 into the release AV_3_0$ git merge BUG_1warning: Cannot merge binary files: ui_forms/mv_anzmd.fmb (HEAD vs. BUG_1)Auto-merging ui_forms/mv_anzmd.fmbCONFLICT (content): Merge conflict in ui_forms/mv_anzmd.fmb
# .. lets merge BUG_1 and CR_1$ git mergetool --tool=fapi *fmbMerging:
# .. and commit the merge $ git commit
26
Aaarghhhh… OK überzeugt. Lass es uns versuchen!
https://pixabay.com/photo-384083/
27
Vielen Dank für Ihre Aufmerksamkeit
28https://pixabay.com/photo-1913167/
“Oracle'slong-established technology to design and build enterprise applications quicklyand efficiently, continuous to evolve over the years,remaining the technology of choice for thousands of developers and partners worldwide.”
Mit dem aktuellen 12c Forms Release spricht sich Oracle klar für ein Fortbestehen dieser Technologie aus!
29https://pixabay.com/photo-2036220/
30
Some Git Basics