Skip to content

Commit

Permalink
- Protect against relative path failures, like C: to D:
Browse files Browse the repository at this point in the history
- Add Ruby 3.3 testing
- Report recently added exceptions as exceptions to logging decorator.
  • Loading branch information
mvandervoord committed Oct 23, 2024
1 parent cb01ae0 commit 37fc98a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['3.0', '3.1', '3.2']
ruby: ['3.0', '3.1', '3.2', '3.3']
steps:
# Use a cache for our tools to speed up testing
- uses: actions/cache@v4
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['3.0', '3.1', '3.2']
ruby: ['3.0', '3.1', '3.2', '3.3']
steps:
# Use a cache for our tools to speed up testing
- uses: actions/cache@v4
Expand Down Expand Up @@ -288,14 +288,3 @@ jobs:
asset_name: ceedling-${{ env.ceedling_build }}.gem
asset_content_type: test/x-gemfile

# - name: Upload Pre-Release Gem
# uses: softprops/action-gh-release@v2
# with:
# # repo_token: "${{ secrets.GITHUB_TOKEN }}"
# body: |
# [Release Notes](${{ github.workspace }}/docs/ReleaseNotes.md)
# name: ${{ env.full_ver }}
# prerelease: true
# files: |
# *.gem

4 changes: 2 additions & 2 deletions lib/ceedling/build_batchinator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def exec(workload:, things:, &block)

# ThreadError outside scope of expected empty queue condition
unless e.message.strip.casecmp("queue empty")
@loginator.log(e.message, Verbosity::ERRORS)
@loginator.log(e.message, Verbosity::ERRORS, LogLabels::EXCEPTION )

# Shutdown all worker threads
shutdown_threads(threads)
Expand All @@ -82,7 +82,7 @@ def exec(workload:, things:, &block)
# 1. Calling code knows something bad happened and handles appropriately
# 2. Ruby runtime can handle most serious problems
rescue Exception => e
@loginator.log(e.message, Verbosity::ERRORS)
@loginator.log(e.message, Verbosity::ERRORS, LogLabels::EXCEPTION )

# Shutdown all worker threads
shutdown_threads(threads)
Expand Down
21 changes: 11 additions & 10 deletions lib/ceedling/file_path_collection_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def setup()
@working_dir_path = Pathname.new( Dir.pwd() )
end


# Build up a directory path list from one or more strings or arrays of (+:/-:) simple paths & globs
def collect_paths(paths)
plus = Set.new # All real, expanded directory paths to add
Expand Down Expand Up @@ -78,11 +77,7 @@ def collect_paths(paths)

# Use Set subtraction operator to remove any excluded paths
paths = (plus - minus).to_a

paths.map! do |path|
# Reform path from full absolute to nice, neat relative path instead
(Pathname.new( path ).relative_path_from( @working_dir_path )).to_s()
end
paths.map! {|path| shortest_path_from_working(path) }

return paths
end
Expand Down Expand Up @@ -124,13 +119,19 @@ def revise_filelist(list, revisions)

# Use Set subtraction operator to remove any excluded paths
paths = (plus - minus).to_a
paths.map! {|path| shortest_path_from_working(path) }

paths.map! do |path|
return FileList.new( paths )
end

def shortest_path_from_working(path)
begin
# Reform path from full absolute to nice, neat relative path instead
(Pathname.new( path ).relative_path_from( @working_dir_path )).to_s()
(Pathname.new( path ).relative_path_from( @working_dir_path )).to_s
rescue
# If we can't form a relative path between these paths, use the absolute
path
end

return FileList.new( paths )
end

end
2 changes: 1 addition & 1 deletion lib/ceedling/plugin_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def load_programmatic_plugins(plugins, system_objects)
# Add plugins to hash of all system objects
system_objects[hash[:plugin].downcase().to_sym()] = object
rescue
@loginator.log( "Exception raised while trying to load plugin: #{hash[:plugin]}", Verbosity::ERRORS )
@loginator.log( "Exception raised while trying to load plugin: #{hash[:plugin]}", Verbosity::ERRORS, LogLabels::EXCEPTION )
raise # Raise again for backtrace, etc.
end
end
Expand Down
6 changes: 5 additions & 1 deletion plugins/dependencies/lib/dependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,11 @@ def build_lib(blob)
name = blob[:name] || ""
source_path = Pathname.new get_source_path(blob)
build_path = Pathname.new get_build_path(blob)
relative_build_path = build_path.relative_path_from(source_path)
relative_build_path = begin
build_path.relative_path_from(source_path)
rescue
build_path
end

# Verify there is an artifact that we're building that makes sense
libs = []
Expand Down

0 comments on commit 37fc98a

Please sign in to comment.