Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by...

27
Special Topics Yaay!!

Transcript of Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by...

Page 1: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Special TopicsYaay!!

Page 2: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Administrivia● HW9 will be out by tomorrow. Is due about 10 days from tomorrow● HW8 is due on Wednesday, with 1 late day allowed that can be upto 120

hours● No staff support from Thursday through Monday evening for HW8● Lots of Extra OH this week, but get to it sooner because a lot of the staff will

not be available on Wednesday, so no expectations for Piazza/Email replies● Those who submit HW8 on Wednesday will get feedback by Monday. Others

will get it by next Friday (after HW9 is due)● Mike doesn’t have OH this week. Avidant’s OH are extended today. Look at

the calendar for more details of who/when/where for the next 60 hours

Page 3: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Typical Development Lifecycle

1. Get the source code2. Install dependencies3. Compile the code4. Run static analysis5. Generate documentation6. Run tests7. Create artifacts for customer8. Ship!

Page 4: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Which of these do we have to manually?

1. Get the source code2. Install dependencies3. Compile the code4. Run static analysis5. Generate documentation6. Run tests7. Create artifacts for customer8. Ship!

NONE!

NADA!

ZIPPO!

NILL!

HECK NO!

ZIPPITY NOO WOP!

Page 5: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Build Systems

Page 6: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

What is a build system? A tool that does all of these things automatically:

1. Get the source code2. Install dependencies3. Compile the code4. Run static analysis5. Generate documentation6. Run tests7. Create artifacts for customer8. Ship!

tasks

Page 7: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Tasks we’ve seen

● Build● Test● Reformat● validateWorkingCopy● validateLocalRepository● validateRemoteRepository

Generally in every build system

Specific to this class

Page 8: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

When you run “./gradlew build”

1. Some stuff prints to the console2. ???3. Everything breaks!

Page 9: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

When you run “./gradlew build”

1. Some stuff prints to the console2. ???3. Everything b̶r̶e̶a̶k̶s̶ works!

Page 10: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

When you run “./gradlew build”

1. Installs all dependencies 2. Compiles all files3. Ensures files are in correct location4. Run tests5. Runs static analysis tools6. Everything b̶r̶e̶a̶k̶s̶ works!

Page 11: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

● Cleans the directory● Runs everything “build” runs● Checks whether required files in the correct location● “validateLocalRepository” also checks all files are committed● “validateRemoteRepository” also checks all commits are pushed

When you run “./gradlew validate...”

JUST CODE

Page 12: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Which task gets to go first?

validate...

Run hw4 tests

Run hw3 tests

Compile hw3

Compile hw4

0

1

1

2

2

Page 13: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Which task gets to go first?

validate...

Run hw4 tests

Run hw3 tests

Compile hw3

Compile hw4

0

0

0

1

2

Page 14: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Which task gets to go first?

validate...

Run hw4 tests

Run hw3 tests

Compile hw3

Compile hw4

0

0

0

1

1

Page 15: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Which task gets to go first?

validate...

Run hw4 tests

Run hw3 tests

Compile hw3

Compile hw4

0

0

0

0

1

Page 16: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Which task gets to go first?

validate...

Run hw4 tests

Run hw3 tests

Compile hw3

Compile hw4

0

0

0

0

0

Page 17: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Which task gets to go first?

validate...

Run hw4 tests

Run hw3 tests

Compile hw3

Compile hw4

0

0

0

0

0

Page 18: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Git

Page 19: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Basic Git Commands you all know (kinda)● pull● add● commit● push

Page 20: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

What happens to the commits?git log

git log --author=???

git log --oneline

git log --pretty=short/medium

git log --graph

Page 21: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

What is the history?Pick a random commit

git show <SHA>

git tag

Pick a random tag

git show <TAG-NAME>

Page 22: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

But that’s annoyinggit blame .gitignore

git blame ci/pipeline.yml

git blame -e .gitignore

Page 23: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Navigating the historygit checkout <COMMIT-SHA>

git checkout <TAG-NAME>

Page 24: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Undoing mistakesgit revert <COMMIT-SHA>

git revert HEAD~3

Page 25: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Branchesgit branch

git branch -a

git checkout -b <NEW BRANCH NAME>

git branch -D <BRANCH-NAME>

Page 26: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Stashgit stash

git stash show

git stash

git stash show

git stash list

git stash show stash@{0}

git stash pop

Page 27: Special Topics - University of Washington...Special Topics Yaay!! Administrivia HW9 will be out by tomorrow. Is due about 10 days from tomorrow HW8 is due on Wednesday, with 1 late

Javascript