Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear build dir on thumbot retry #61

Merged
merged 3 commits into from
Dec 9, 2016
Merged

Clear build dir on thumbot retry #61

merged 3 commits into from
Dec 9, 2016

Conversation

davidx
Copy link
Contributor

@davidx davidx commented Dec 9, 2016

This blows away the build directory during a retry so that a completely fresh state can be attained.
For potential forensics, the build dir will actually be moved to a backup directory, to be truncated from disk at a later time.
This pr also adds behavior that instead of updating the existing build status, it now creates a new build status comment and removes the old one.

example: davidx/prtester#330

@thumbot
Copy link
Collaborator

thumbot commented Dec 9, 2016

Thanks @davidx!

Settings
---
minimum_reviewers: 1
build_steps:
- bundle install
- bundle exec ruby test/test.rb
merge: true
org_mode: true
timeout: 1805
shell: "/bin/bash"
env:
  BUNDLE_GEMFILE: Gemfile

@thumbot
Copy link
Collaborator

thumbot commented Dec 9, 2016

clean_on_retry 75631dd ➡️ master d84263f ✅ completed
Looks good! 👍
✅ MERGE

Started at: 2016-12-08 22:10
Duration: 1 seconds.
Result: OK
Message: Merge Success: clean_on_retry 75631dd onto target branch: master d84263f
Exit Code: OK

📄







  Updating d84263f..75631dd
Fast-forward (no commit created; -m option ignored)
 lib/thumbs/pull_request_worker.rb | 5 +++++
 1 file changed, 5 insertions(+)




✅ BUNDLE_INSTALL

Started at: 2016-12-08 22:10
Duration: 1 seconds.
Result: OK
Message: OK
Exit Code: 0

📄


cd /tmp/thumbs/master.d84263f.clean_on_retry.75631dd; bundle install




  Using rake 11.3.0
Using concurrent-ruby 1.0.2
Using i18n 0.7.0
Using minitest 5.10.1
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using rack 2.0.1
Using public_suffix 2.0.4
Using mime-types-data 3.2016.0521
Using safe_yaml 1.0.4
Using diff-lcs 1.2.5
Using unf_ext 0.0.7.2
Using dust 0.1.6
Using excon 0.54.0
Using multipart-post 2.0.0
Using git 1.3.0
Using graphql 1.1.0
Using hashdiff 0.3.1
Using hijack 0.2.1
Using http-form_data 1.0.1
Using http_parser.rb 0.6.0
Using kgio 2.10.0
Using log4r 1.1.10
Using method_source 0.8.2
Using mustermann 1.0.0.beta2
Using netrc 0.11.0
Using power_assert 0.4.1
Using thor 0.19.4
Using raindrops 0.17.0
Using rspec-support 3.5.0
Using tilt 2.0.5
Using vcr 3.0.3
Using bundler 1.13.6
Using tzinfo 1.2.2
Using nokogiri 1.6.8.1
Using rack-test 0.6.3
Using rack-protection 2.0.0.beta2
Using addressable 2.5.0
Using mime-types 3.1
Using crack 0.4.3
Using unf 0.1.4
Using faraday 0.10.0
Using test-unit 3.2.3
Using unicorn 5.2.0
Using rspec-core 3.5.4
Using rspec-expectations 3.5.0
Using rspec-mocks 3.5.0
Using activesupport 5.0.0.1
Using loofah 2.0.3
Using xpath 2.0.0
Using sinatra 2.0.0.beta2
Using webmock 2.3.0
Using domain_name 0.5.20161129
Using sawyer 0.8.1
Using rails-dom-testing 2.0.1
Using graphql-client 0.2.3
Using rails-html-sanitizer 1.0.3
Using capybara 2.11.0
Using http-cookie 1.0.3
Using octokit 4.6.2
Using actionview 5.0.0.1
Using http 2.1.0
Using actionpack 5.0.0.1
Using railties 5.0.0.1
Using rspec-rails 3.5.2
Bundle complete! 22 Gemfile dependencies, 67 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.





✅ BUNDLE_EXEC_RUBY_TEST/TEST.RB

Started at: 2016-12-08 22:10
Duration: 267 seconds.
Result: OK
Message: OK
Exit Code: 0

📄


cd /tmp/thumbs/master.d84263f.clean_on_retry.75631dd; bundle exec ruby test/test.rb




  /tmp/thumbs/master.d84263f.clean_on_retry.75631dd/test/test_common.rb:127: warning: key :record is duplicated and overwritten on line 127
Loaded suite test/test
Started
...........................................................................

Finished in 260.361356077 seconds.
------
75 tests, 203 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
------
0.29 tests/s, 0.78 assertions/s





⬜ 0 of 1 Code reviews from organization basho-labs

@davidx davidx changed the title re(move) build dir Clear build dir on thumbot retry Dec 9, 2016
@thumbot
Copy link
Collaborator

thumbot commented Dec 9, 2016

clean_on_retry b73c84f ➡️ master d84263f ✅ completed
Looks good! 👍
✅ MERGE

Started at: 2016-12-08 22:21
Duration: 1 seconds.
Result: OK
Message: Merge Success: clean_on_retry b73c84f onto target branch: master d84263f
Exit Code: OK

📄







  Updating d84263f..b73c84f
Fast-forward (no commit created; -m option ignored)
 lib/thumbs/pull_request_worker.rb | 6 ++++++
 1 file changed, 6 insertions(+)




✅ BUNDLE_INSTALL

Started at: 2016-12-08 22:21
Duration: 1 seconds.
Result: OK
Message: OK
Exit Code: 0

📄


cd /tmp/thumbs/master.d84263f.clean_on_retry.b73c84f; bundle install




  Using rake 11.3.0
Using concurrent-ruby 1.0.2
Using i18n 0.7.0
Using minitest 5.10.1
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using rack 2.0.1
Using public_suffix 2.0.4
Using mime-types-data 3.2016.0521
Using safe_yaml 1.0.4
Using diff-lcs 1.2.5
Using unf_ext 0.0.7.2
Using dust 0.1.6
Using excon 0.54.0
Using multipart-post 2.0.0
Using git 1.3.0
Using graphql 1.1.0
Using hashdiff 0.3.1
Using hijack 0.2.1
Using http-form_data 1.0.1
Using http_parser.rb 0.6.0
Using kgio 2.10.0
Using log4r 1.1.10
Using method_source 0.8.2
Using mustermann 1.0.0.beta2
Using netrc 0.11.0
Using power_assert 0.4.1
Using thor 0.19.4
Using raindrops 0.17.0
Using rspec-support 3.5.0
Using tilt 2.0.5
Using vcr 3.0.3
Using bundler 1.13.6
Using tzinfo 1.2.2
Using nokogiri 1.6.8.1
Using rack-test 0.6.3
Using rack-protection 2.0.0.beta2
Using addressable 2.5.0
Using mime-types 3.1
Using crack 0.4.3
Using unf 0.1.4
Using faraday 0.10.0
Using test-unit 3.2.3
Using unicorn 5.2.0
Using rspec-core 3.5.4
Using rspec-expectations 3.5.0
Using rspec-mocks 3.5.0
Using activesupport 5.0.0.1
Using loofah 2.0.3
Using xpath 2.0.0
Using sinatra 2.0.0.beta2
Using webmock 2.3.0
Using domain_name 0.5.20161129
Using sawyer 0.8.1
Using rails-dom-testing 2.0.1
Using graphql-client 0.2.3
Using rails-html-sanitizer 1.0.3
Using capybara 2.11.0
Using http-cookie 1.0.3
Using octokit 4.6.2
Using actionview 5.0.0.1
Using http 2.1.0
Using actionpack 5.0.0.1
Using railties 5.0.0.1
Using rspec-rails 3.5.2
Bundle complete! 22 Gemfile dependencies, 67 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.





✅ BUNDLE_EXEC_RUBY_TEST/TEST.RB

Started at: 2016-12-08 22:21
Duration: 338 seconds.
Result: OK
Message: OK
Exit Code: 0

📄


cd /tmp/thumbs/master.d84263f.clean_on_retry.b73c84f; bundle exec ruby test/test.rb




  /tmp/thumbs/master.d84263f.clean_on_retry.b73c84f/test/test_common.rb:127: warning: key :record is duplicated and overwritten on line 127
Loaded suite test/test
Started
...........................................................................

Finished in 329.462042528 seconds.
------
75 tests, 203 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
------
0.23 tests/s, 0.62 assertions/s





⬜ 0 of 1 Code reviews from organization basho-labs

@@ -920,6 +920,10 @@ def comment_code_approvals
code_reviews
end

def remove_build_dir
FileUtils.mv(@build_dir, "#{@build_dir}.#{DateTime.now.strftime("%s")}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps move to /tmp instead?

Copy link
Contributor Author

@davidx davidx Dec 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, its already in tmp :) (by default, this way it'll move it relative to the toplevel build dir. /tmp/thumbs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paegun ^^ .

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see build_dir as /tmp/thumbs/<unique_dir_name> , so this will technically move the directory to be a child of the build directory, so would cause problems for projects that recursively perform actions w/i their build directory. I think it is better to move the directory up to /tmp/thumbs/garbage or the like.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, this will move the directory to a new name,
/tmp/thumbs/build_guid gets moved to directory /tmp/thumbs/build_guid.timestamp
So completely separate directories.
But for cleanliness and future dealing with the output cruft, I agree it should be in a special place like /tmp/thumbs/archive.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as it's not a child, :)

@paegun
Copy link

paegun commented Dec 9, 2016

+1

@thumbot
Copy link
Collaborator

thumbot commented Dec 9, 2016

✅ 1 of 1 Code reviews from organization basho-labs

@thumbot
Copy link
Collaborator

thumbot commented Dec 9, 2016

Merging and closing this pr

@thumbot
Copy link
Collaborator

thumbot commented Dec 9, 2016

Successfully merged basho-labs/thumbs/pulls/61 (b73c84f on to master)

---
:sha: 6e2b74211215a82a2ccbee68dfef8bb65756caf4
:merged: true
:message: Pull Request successfully merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants