Skip to content

Commit

Permalink
update gitrb because github is now refusing its timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
bronson committed Jun 23, 2011
1 parent cc455b6 commit 26aa456
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -8,7 +8,6 @@ gem 'mimemagic' ,'= 0.1.7'
gem 'hpricot' ,'= 0.8.2' gem 'hpricot' ,'= 0.8.2'


gem 'json' ,'~> 1.4.6' gem 'json' ,'~> 1.4.6'
gem 'gitrb' ,'~> 0.2.7'
gem 'bzip2-ruby' ,'~> 0.2.6' gem 'bzip2-ruby' ,'~> 0.2.6'
gem 'mime-types' ,'~> 1.16' gem 'mime-types' ,'~> 1.16'
gem 'octokit' ,'~> 0.5' gem 'octokit' ,'~> 0.5'
Expand All @@ -20,6 +19,7 @@ gem 'mail' ,'~> 2.2.7'
gem 'i18n' ,'~> 0.4.1' gem 'i18n' ,'~> 0.4.1'


gem 'retryable' , :git => 'git://github.com/bronson/retryable.git' gem 'retryable' , :git => 'git://github.com/bronson/retryable.git'
gem 'gitrb' , :git => 'git://github.com/bronson/gitrb.git', :branch => 'patch-1'


group :test do group :test do
gem 'rspec' ,'~> 2.5' gem 'rspec' ,'~> 2.5'
Expand Down
10 changes: 8 additions & 2 deletions Gemfile.lock
@@ -1,3 +1,10 @@
GIT
remote: git://github.com/bronson/gitrb.git
revision: b026b6a45e95e36ff2759ba1d05ea6058a161dd0
branch: patch-1
specs:
gitrb (0.2.8)

GIT GIT
remote: git://github.com/bronson/retryable.git remote: git://github.com/bronson/retryable.git
revision: a21655fa16330382e54a9ddba583a566399ab3b1 revision: a21655fa16330382e54a9ddba583a566399ab3b1
Expand Down Expand Up @@ -39,7 +46,6 @@ GEM
loofah (>= 0.3.1) loofah (>= 0.3.1)
nokogiri (> 0.0.0) nokogiri (> 0.0.0)
sax-machine (>= 0.0.12) sax-machine (>= 0.0.12)
gitrb (0.2.8)
hashie (1.0.0) hashie (1.0.0)
hpricot (0.8.2) hpricot (0.8.2)
htmlentities (4.2.4) htmlentities (4.2.4)
Expand Down Expand Up @@ -88,7 +94,7 @@ DEPENDENCIES
bzip2-ruby (~> 0.2.6) bzip2-ruby (~> 0.2.6)
erubis (~> 2.6.6) erubis (~> 2.6.6)
feedzirra (~> 0.0.24) feedzirra (~> 0.0.24)
gitrb (~> 0.2.7) gitrb!
hashie (~> 1.0) hashie (~> 1.0)
hpricot (= 0.8.2) hpricot (= 0.8.2)
htmlentities (~> 4.2.1) htmlentities (~> 4.2.1)
Expand Down
24 changes: 24 additions & 0 deletions TODO
@@ -1,3 +1,18 @@
push repos/dbext.vim
~/vim-scraper/repos/dbext.vim.git$ git push origin master
Counting objects: 17, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (9/9), 4.05 KiB, done.
Total 9 (delta 4), reused 0 (delta 0)
error: object 03bd05f29539d9c266815fa431c48db2be715baf:invalid author/committer line - bad time zone
fatal: Error in object
error: unpack failed: unpack-objects abnormal exit
To git@vim-scripts.github.com:vim-scripts/dbext.vim
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'git@vim-scripts.github.com:vim-scripts/dbext.vim'


Make retryable accept a string to log, it logs it with a retry count. Make retryable accept a string to log, it logs it with a retry count.
Factor into modules. Factor into modules.
Store all scripts in a single gigantic scripts.json file. Store all scripts in a single gigantic scripts.json file.
Expand All @@ -11,6 +26,15 @@ Make more resilient against intermittent failures
(simple reload seems to fix it every time) (simple reload seems to fix it every time)
We should probably re-fetch the script at least once if hpricot dies with an error. We should probably re-fetch the script at least once if hpricot dies with an error.


/home/bronson/.rvm/gems/ruby-1.9.2-p0/gems/gitrb-0.2.8/lib/gitrb/repository.rb:310:in `method_missing': git push failed (Gitrb::CommandError)
from ./scraper:1317:in `block in perform_push'
from /home/bronson/.rvm/gems/ruby-1.9.2-p0/bundler/gems/retryable-retryablea21655fa1633/lib/retryable.rb:38:in `retryable'
from ./scraper:1310:in `perform_push'
from ./scraper:1372:in `perform_all'
from ./scraper:1310593:in `block in <main>'
from ./scraper:1585:in `each'
from ./scrapers:1585:in `<main>'

Processing script 2685: zOS-Enterprise-Compiler-PLI Processing script 2685: zOS-Enterprise-Compiler-PLI
downloading http://www.vim.org/scripts/script.php?script_id=2686 downloading http://www.vim.org/scripts/script.php?script_id=2686
./scraper:481:in `githubify': undefined method `gsub' for nil:NilClass (NoMethodError) ./scraper:481:in `githubify': undefined method `gsub' for nil:NilClass (NoMethodError)
Expand Down
4 changes: 3 additions & 1 deletion scraper
Expand Up @@ -1308,7 +1308,9 @@ def perform_push repo_name
repo.git_remote('rm', 'origin') rescue nil repo.git_remote('rm', 'origin') rescue nil
repo.git_remote('add', 'origin', remote_url(script)) repo.git_remote('add', 'origin', remote_url(script))
retryable do |retries| retryable do |retries|
# Gitrb::CommandError is as close to a network timeout error as we're going to get # TODO: This is a problem, we get a Gitrb command error if there are
# local repo issues, AND when there's a network error. Don't want to
# retry local errors. Write our own push so we can differentiate?
puts " #{"force " if ENV['FORCE']}pushing #{script['script_id']} - #{script['name']}#{retries > 0 ? " RETRY #{retries}" : ""}" puts " #{"force " if ENV['FORCE']}pushing #{script['script_id']} - #{script['name']}#{retries > 0 ? " RETRY #{retries}" : ""}"
args = ['--tags'] args = ['--tags']
args << '--force' if ENV['FORCE'] args << '--force' if ENV['FORCE']
Expand Down

0 comments on commit 26aa456

Please sign in to comment.