Skip to content

Commit

Permalink
Some files now in Puppet
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbASF committed Sep 13, 2024
1 parent fa0c026 commit 9c76675
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/spec/lib/svn_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
it 'should return an array of size 2' do
res = ASF::SVN.private_public
expect(res.size()).to eq(2)
expect(res[0].size).to eq(15) # will need to be adjusted from time to time
expect(res[0].size).to eq(13) # will need to be adjusted from time to time
expect(res[1].size).to eq(6) # ditto.
end
end
Expand Down
5 changes: 3 additions & 2 deletions lib/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
lib = File.expand_path('..', __dir__)
$LOAD_PATH.unshift lib unless $LOAD_PATH.include? lib

require 'wunderbar' # may be needed by svn
require 'whimsy/asf/config' # must be loaded before updating config
require 'whimsy/asf/svn' # must be loaded before updating config
# Don't load 'whimsy/asf' here as some classes may depend on overrides below
Expand All @@ -25,10 +26,10 @@
SAMPLE_SVN_URL_RE = %r{https://.+/minutes}

# Override with test data if there is no checkout available (allows local use)
if ENV['RAKE_TEST'] == 'TRUE' or not (ASF::SVN.find('apmail_bin') and ASF::SVN.find('board'))
if ENV['RAKE_TEST'] == 'TRUE' or not (File.exist?(File.join(ASF::Config[:puppet_data], 'apmail_bin')) and ASF::SVN.find('board'))
TEST_DATA = true # Test data is smaller so some tests need adjusting
puts 'Overriding data directories'
ASF::SVN['apmail_bin'] = File.expand_path('../test/svn/apmail_bin', __dir__)
ASF::Config[:puppet_data] = File.expand_path('../test/puppet-data', __dir__)
ASF::SVN['board'] = File.expand_path('../test/svn/board', __dir__)
ASF::SVN[SAMPLE_SVN_NAME] = File.expand_path('../test/svn/minutes', __dir__)
ASF::Config[:subscriptions] = File.expand_path('../test/subscriptions', __dir__)
Expand Down
3 changes: 2 additions & 1 deletion lib/whimsy/asf/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ class Authorization
include Enumerable

# N.B. This data is maintained by a cron job on the Whimsy server, which has access
PUPPET_PATH = '/srv/puppet-data/authorization' # Puppet auth data is stored here
PUPPET_DATA = ASF::Config[:puppet_data]
PUPPET_PATH = File.join(PUPPET_DATA, 'authorization') # Puppet auth data is stored here

# Return the set of authorizations a given user (availid) has access to.
def self.find_by_id(value)
Expand Down
2 changes: 2 additions & 0 deletions lib/whimsy/asf/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class Config
# default location of LDAP credentials
@config[:ldap_creds] ||= '/srv/ldap.txt'

# default location of Puppet data
@config[:puppet_data] ||= '/srv/puppet-data'

# The cache is used for local copies of SVN files that may be updated by Whimsy
# for example: podlings.xml
Expand Down
2 changes: 1 addition & 1 deletion lib/whimsy/asf/icla.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def self.sort(source)
# list of mails rejected by badrcptto and badrcptto_patterns
# Not intended for external use
def self.badmails
qmc = ASF::SVN['qmail_control']
qmc = File.join(ASF::Config[:puppet_data], 'qmail_control')
# non-patterns
brt = File.join(qmc, 'badrcptto')
badmails = File.read(brt).scan(/^(\w.+)@apache\.org\s*$/).flatten
Expand Down
2 changes: 1 addition & 1 deletion lib/whimsy/asf/mail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def self.to_canonical(email)

# Load the auto-subscription file
def self._load_auto
apmail_bin = ASF::SVN['apmail_bin']
apmail_bin = File.join(ASF::Config[:puppet_data], 'apmail_bin') # Loaded by puppet
auto_file = File.join(apmail_bin, 'mail_list_autosub.yml')
auto_mtime = File.mtime(auto_file) # fetch this up front in case file updated during loading
if not @auto or auto_mtime != @auto_mtime
Expand Down
14 changes: 0 additions & 14 deletions repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
files:
- apacheconhistory.csv

apmail_bin:
url: infra/infrastructure/apmail/trunk/bin
depth: empty
files:
- mail_list_autosub.yml

attic-xdocs:
url: asf/attic/site/xdocs/projects
depth: delete
Expand Down Expand Up @@ -166,14 +160,6 @@
url: private/foundation/officers/personnel-duties
depth: files

# for access to badrcptto files:
qmail_control:
url: infra/infrastructure/trunk/qmail/control
depth: empty
files:
- badrcptto
- badrcptto_patterns

# for Treasurer access to financial records
records:
url: asf/infrastructure/site/trunk/content/foundation/records
Expand Down

0 comments on commit 9c76675

Please sign in to comment.