• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / lib_jobs / c9db9174-d6c5-4d36-908b-2333f1b04a24

08 Oct 2025 04:49PM UTC coverage: 96.043% (-0.3%) from 96.319%
c9db9174-d6c5-4d36-908b-2333f1b04a24

push

circleci

christinach
connect to archivespace set the git_lab_eac as a git repo
process all agent types and saves CPF.xml to the eacs dir
in the gitlab repo git_lab_eacs/eacs/
Uses the Gitlab class to connect to Gitlab
Adds new methods to commit and push to gitlab eacs directory

related to [#968]

32 of 42 new or added lines in 2 files covered. (76.19%)

1 existing line in 1 file now uncovered.

3374 of 3513 relevant lines covered (96.04%)

1209.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.36
/app/models/aspace_version_control/git_lab.rb
1
# frozen_string_literal: true
2

3
module AspaceVersionControl
1✔
4
  # This class is responsible for committing EADs to GitLab for version control
5
  class GitLab
1✔
6
    def initialize(repo_path: nil)
1✔
7
      @custom_repo_path = repo_path
31✔
8
    end
9

10
    def commit_eads_to_git(path:)
1✔
11
      update(path:)
22✔
12
      return unless changes?(path:)
22✔
13
      add(path:)
1✔
14
      commit('monthly snapshot of ASpace EADs')
1✔
15
      push
1✔
16
    end
17

18
    def commit_eacs_to_git(path:)
1✔
NEW
19
      update(path:)
×
NEW
20
      return unless changes?(path:)
×
NEW
21
      add(path:)
×
NEW
22
      commit('monthly snapshot of ASpace Agent EACs')
×
UNCOV
23
      push
×
24
    end
25

26
    def repo
1✔
27
      @repo ||=
86✔
28
        begin
29
          Git.clone(GitLab.git_uri, current_repo_path)
31✔
30
        rescue Git::Error, Git::FailedError
31
          Git.open(current_repo_path)
1✔
32
        end
33
    end
34

35
    def current_repo_path
1✔
36
      @custom_repo_path || GitLab.git_repo_path
32✔
37
    end
38

39
    def update(path:)
1✔
40
      repo.checkout('HEAD', path:)
28✔
41
      repo.pull
28✔
42
    end
43

44
    def add(path:)
1✔
45
      repo.add(path)
2✔
46
    end
47

48
    def commit(message = 'monthly snapshot of ASpace EADs')
1✔
49
      repo.commit(message)
1✔
50
    end
51

52
    delegate :push, to: :repo
1✔
53

54
    def changes?(path:)
1✔
55
      repo_status = repo.status
22✔
56
      changed = repo_status.changed.present? || repo_status.untracked.present?
22✔
57
      return true if changed
22✔
58
      Rails.logger.info("No changes present for #{path}")
21✔
59
      false
21✔
60
    end
61

62
    def self.git_uri
1✔
63
      @git_uri ||= "git@#{config.git_lab_host}:#{config.git_lab_source_path}.git"
32✔
64
    end
65

66
    def self.git_repo_path
1✔
67
      @git_repo_path ||= config.local_git_lab_dir
33✔
68
    end
69

70
    def self.git_repo_eacs_path
1✔
NEW
71
      @git_repo_eacs_path ||= config.local_git_lab_eacs_dir
×
72
    end
73

74
    def self.config
1✔
75
      @config ||= Rails.application.config.aspace
3✔
76
    end
77
  end
78
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc