pmdtester 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d00209411d45b04f8ebcfb34d4289b682a9c3d044998b1f82e15c1d08e184ed
4
- data.tar.gz: d6d6a48c4a2c558b9058c91dc57e2043e304addc90b8e7cc7441f07c50dac624
3
+ metadata.gz: 733a4296c7168a518aa22c6fde568d2b3bf966ee99711e17a06dac851605f290
4
+ data.tar.gz: 5b900068f5483c479d6184600bcd78c20faf9b83bc9db2bbe12ec2c78d0328cd
5
5
  SHA512:
6
- metadata.gz: 82c0d9bce215128d2fb56f44116c7c6f5394b8a34ff8b26918974a89e2c6e67b4d76c14b3a920b372e345ffbe33e114cdacfbcdd962f1c76f5fddc24595d8998
7
- data.tar.gz: effbb41f97137a0b6a93bc200cd8ebb3b7323dabaeef1eca50bfee3dd97b00e0418987b28661328902b1f66942843acad32bc397f1dc04590cbc9d0a19d1c4b7
6
+ metadata.gz: '039f00d21c56f0ae4c59ff5343e40a9ee9361c6514b2ab62e276c81877a3f4a59506639c2ad7c0be2eb0d3e2011698e2e6e16711ee97928519ba685a4dc1d139'
7
+ data.tar.gz: 54cce64c7f1e995178a90d0a09da3b1afdf42a62e825fdc74827ef5b9ff453b102fc1e04e8c3ecf2fd797d7981b1079de72f883d849ba87fed1175db03b54e79
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 1.5.1 / 2022-05-12
2
+
3
+ ## Fixed Issues
4
+
5
+ * [#106](https://github.com/pmd/pmd-regression-tester/issues/106): git clone/checkout fails when using commit sha1 as tag
6
+
1
7
  # 1.5.0 / 2022-05-06
2
8
 
3
9
  ## Enhancements
data/README.rdoc CHANGED
@@ -155,3 +155,4 @@ The tool creates the following folders:
155
155
  * Push the tag. Github Actions will build and publish the new gem
156
156
  * A github release is automatically created, verify it on https://github.com/pmd/pmd-regression-tester/releases
157
157
  * To make pmd's main CI use the new version (in [pmd/pmd](https://github.com/pmd/pmd/)), go to the root directory and run `bundle lock --update`. Commit these changes.
158
+ * Rename milestone to version, close it and create a new "Next" milestone: https://github.com/pmd/pmd-regression-tester/milestones
@@ -19,22 +19,28 @@ module PmdTester
19
19
  logger.info "Start cloning #{project.name} repository"
20
20
  path = project.clone_root_path
21
21
 
22
+ raise "Unsupported project type '#{project.type}' - only git is supported" unless project.type == 'git'
23
+
22
24
  if File.exist?(path)
23
25
  logger.warn "Skipping clone, project path #{path} already exists"
24
26
  else
25
- raise "Unsupported project type '#{project.type}' - only git is supported" unless project.type == 'git'
26
-
27
- # git:
28
- # Don't download whole history
29
- # Note we don't use --single-branch, because the repo is downloaded
30
- # once but may be used with several tags.
31
- clone_cmd = "git clone --no-single-branch --depth 1 #{project.connection} #{path}"
32
-
27
+ # Don't download whole history. This just fetches HEAD, the correct ref is fetched below.
28
+ clone_cmd = "git clone --single-branch --depth 1 #{project.connection} #{path}"
33
29
  Cmd.execute_successfully(clone_cmd)
34
30
  end
35
31
 
36
32
  Dir.chdir(path) do
37
- execute_reset_cmd(project.type, project.tag)
33
+ # this works with tags, branch names and (full-length) hashes
34
+ # first move to a different (temporary) branch, in case we are already on the branch that we want to update
35
+ Cmd.execute_successfully('git checkout -b fetched/temp')
36
+ # fetches any new commits. Could also be a tag.
37
+ Cmd.execute_successfully("git fetch --depth 1 origin #{project.tag}")
38
+ # update the branch to work on based on the new fetch. Creates a new branch if it doesn't exist already
39
+ Cmd.execute_successfully("git branch --force fetched/#{project.tag} FETCH_HEAD")
40
+ # checkout the updated branch
41
+ Cmd.execute_successfully("git checkout fetched/#{project.tag}")
42
+ # remove the temporary branch
43
+ Cmd.execute_successfully('git branch -D fetched/temp')
38
44
  end
39
45
  logger.info "Cloning #{project.name} completed"
40
46
  end
@@ -93,13 +99,5 @@ module PmdTester
93
99
  end
94
100
  stdout
95
101
  end
96
-
97
- def execute_reset_cmd(type, tag)
98
- raise "Unsupported project type '#{type}' - only git is supported" unless type == 'git'
99
-
100
- reset_cmd = "git checkout #{tag}; git reset --hard #{tag}"
101
-
102
- Cmd.execute_successfully(reset_cmd)
103
- end
104
102
  end
105
103
  end
data/lib/pmdtester.rb CHANGED
@@ -33,7 +33,7 @@ require_relative 'pmdtester/parsers/projects_parser'
33
33
  # and unexpected behaviors will not be introduced to PMD project
34
34
  # after fixing an issue and new rules can work as expected.
35
35
  module PmdTester
36
- VERSION = '1.5.0'
36
+ VERSION = '1.5.1'
37
37
  BASE = 'base'
38
38
  PATCH = 'patch'
39
39
  PR_NUM_ENV_VAR = 'PMD_CI_PULL_REQUEST_NUMBER' # see PmdBranchDetail
data/pmdtester.gemspec CHANGED
@@ -1,17 +1,17 @@
1
1
  # DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake hoe:spec`.
2
2
 
3
3
  # -*- encoding: utf-8 -*-
4
- # stub: pmdtester 1.5.0 ruby lib
4
+ # stub: pmdtester 1.5.1 ruby lib
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "pmdtester".freeze
8
- s.version = "1.5.0"
8
+ s.version = "1.5.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
11
11
  s.metadata = { "bug_tracker_uri" => "https://github.com/pmd/pmd-regression-tester/issues", "homepage_uri" => "https://pmd.github.io", "source_code_uri" => "https://github.com/pmd/pmd-regression-tester" } if s.respond_to? :metadata=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Andreas Dangel".freeze, "Binguo Bao".freeze, "Cl\u00E9ment Fournier".freeze]
14
- s.date = "2022-05-06"
14
+ s.date = "2022-05-12"
15
15
  s.description = "A regression testing tool ensure that new problems and unexpected behaviors will not be introduced to PMD project after fixing an issue , and new rules can work as expected.".freeze
16
16
  s.email = ["andreas.dangel@pmd-code.org".freeze, "djydewang@gmail.com".freeze, "clement.fournier76@gmail.com".freeze]
17
17
  s.executables = ["pmdtester".freeze]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pmdtester
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Dangel
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-05-06 00:00:00.000000000 Z
13
+ date: 2022-05-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri