diff --git a/.github/actions/calculate-version/action.yml b/.github/actions/calculate-version/action.yml new file mode 100644 index 00000000..ffe09e83 --- /dev/null +++ b/.github/actions/calculate-version/action.yml @@ -0,0 +1,42 @@ +# Calculates the next version number. Assumes +# that the code has already been checked out and that +# the fetch-depth is zero: +# +# uses: actions/checkout@v2 +# with: +# fetch-depth: 0 +# +# More details: https://gitversion.net/docs/reference/requirements + +name: 'Calculate Version' +description: 'Calculate the next version number using GitVersion.' + +outputs: + version_formats: + description: 'The various formats for the version. See GitVersion for more details.' + value: ${{ steps.random-number-generator.outputs }} + +runs: + using: "composite" + steps: + - name: Install .NET Core 6 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0.x' + + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.9.13 + with: + versionSpec: '5.10.3' + + - name: GitVersion Config + uses: gittools/actions/gitversion/execute@v0.9.13 + with: + useConfigFile: true + additionalArguments: '/showConfig' + + - name: Determine Version + uses: gittools/actions/gitversion/execute@v0.9.13 + id: gitversion + with: + useConfigFile: true \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 673c12ff..20b09efb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: - ruby-version: 2.5.8 bundler-version: 2.2.32 - run-linter: true + run-linter: false - ruby-version: 2.6.6 bundler-version: 2.2.32 @@ -82,43 +82,25 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - fetch-depth: 0 # Required for GitVersion + fetch-depth: 0 # Required for Calculate Version step (e.g. GitVersion) - - name: Install .NET Core 6 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '6.0.x' - - - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.11 - with: - versionSpec: '5.8.1' - - - name: GitVersion Config - uses: gittools/actions/gitversion/execute@v0.9.11 - with: - useConfigFile: true - additionalArguments: '/showConfig' - - - name: Determine Version - uses: gittools/actions/gitversion/execute@v0.9.11 - id: gitversion - with: - useConfigFile: true + - name: Calculate Version + id: calculate_version + uses: ./.github/actions/calculate-version - name: Update the Version run: | - sed -i 's/.*IDE_VERSION=.*/IDE_VERSION="${{ steps.gitversion.outputs.semver }}"/' lib/ruby-debug-ide/version.rb + sed -i 's/.*IDE_VERSION=.*/IDE_VERSION="${{ steps.calculate_version.outputs.semver }}"/' lib/ruby-debug-ide/version.rb cat lib/ruby-debug-ide/version.rb - name: Create Gem run: | - gem build ruby-debug-ide.gemspec -o corigbytes-ruby-debug-ide-${{ steps.gitversion.outputs.semver }}.gem + gem build ruby-debug-ide.gemspec -o corigbytes-ruby-debug-ide-${{ steps.calculate_version.outputs.semver }}.gem - name: Upload GitHub Workflow Artifacts uses: actions/upload-artifact@v2 with: - name: corigbytes-ruby-debug-ide-${{ steps.gitversion.outputs.semver }}.gem - path: corigbytes-ruby-debug-ide-${{ steps.gitversion.outputs.semver }}.gem + name: corigbytes-ruby-debug-ide-${{ steps.calculate_version.outputs.semver }}.gem + path: corigbytes-ruby-debug-ide-${{ steps.calculate_version.outputs.semver }}.gem \ No newline at end of file diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml new file mode 100644 index 00000000..fb9dfe6c --- /dev/null +++ b/.github/workflows/release-notes.yml @@ -0,0 +1,49 @@ +name: Release Notes +on: + push: + branches: [ master, release* ] + pull_request: + branches: [ master, release* ] + +defaults: + run: + shell: bash + +jobs: + generate-release-notes: + name: Generate Release Notes + runs-on: ubuntu-20.04 + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Required for Calculate Version step (e.g. GitVersion) + + - name: Calculate Version + id: calculate_version + uses: ./.github/actions/calculate-version + + - name: Install GitReleaseManager + uses: gittools/actions/gitreleasemanager/setup@v0.9.13 + with: + versionSpec: '0.13.0' + + # If there are no closed issues generating the Github Release will fail because it raises an exception. + # Work around this by checking for success or no closed issue errors. + - name: Create Release ${{ env.MajorMinorPatch }} + run: | + dotnet gitreleasemanager create --owner corgibytes --repository ruby-debug-ide --token ${{ secrets.GITHUB_TOKEN }} --milestone v${{ env.GitVersion_MajorMinorPatch }} --logFilePath output.txt || true + cat output.txt | grep 'No closed issues have been found for milestone\|Drafted release is available at' + + - name: 'Generate Change Log' + run: | + dotnet-gitreleasemanager export --token ${{ secrets.GITHUB_TOKEN }} -o 'corgibytes' -r 'ruby-debug-ide' -f 'CHANGELOG.md' + git add --renormalize CHANGELOG.md + cat CHANGELOG.md + + - name: 'Commit Change Log if it Changed' + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Committing auto generated change log. + file_pattern: CHANGELOG.md \ No newline at end of file diff --git a/.standard.yml b/.standard.yml index 816447ae..1701cf03 100644 --- a/.standard.yml +++ b/.standard.yml @@ -1,9 +1,2 @@ # Oldest version of Ruby supported by the Debugger. -ruby_version: 1.9.3 - -# Ignore some rules that are only valid in -# newer versions of Ruby. -ignore: - - '**/*': - - Style/SafeNavigation # The & nil check is not available until Ruby 2.3. - - Lint/IncompatibleIoSelectWithFiberScheduler # Couldn't get this recommened fix to work in the interface.rb non_blocking_gets method. \ No newline at end of file +ruby_version: 1.9 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..85e33378 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,22 @@ +## v0.7.100 + + +As part of this release we had [9 issues](https://github.com/corgibytes/ruby-debug-ide/milestone/1?closed=1) closed. + + + +__DevOps__ + +- [__#8__](https://github.com/corgibytes/ruby-debug-ide/pull/8) Create Gemfile package in CI + +__Enhancements__ + +- [__#1__](https://github.com/corgibytes/ruby-debug-ide/pull/1) Docker container for development +- [__#2__](https://github.com/corgibytes/ruby-debug-ide/pull/2) Create GitHub CI +- [__#3__](https://github.com/corgibytes/ruby-debug-ide/pull/3) Get latest changes from Ruby Debug IDE origin +- [__#4__](https://github.com/corgibytes/ruby-debug-ide/pull/4) Trigger CI on PR +- [__#5__](https://github.com/corgibytes/ruby-debug-ide/pull/5) Trigger CI on push and PR +- [__#6__](https://github.com/corgibytes/ruby-debug-ide/pull/6) Add fixed port range +- [__#7__](https://github.com/corgibytes/ruby-debug-ide/pull/7) Add Standard lint checker +- [__#9__](https://github.com/corgibytes/ruby-debug-ide/pull/9) Fixed some new linting errors with new version of Rubocop + diff --git a/Dockerfile b/Dockerfile index 8d1cdf70..ca7299c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ FROM ruby:2.6.6-slim # Install build tooks. -RUN apt update && apt install -y build-essential +RUN apt update && apt install -y build-essential git # Working folder. RUN mkdir /app WORKDIR /app # Setup bundler. -RUN gem update --system 3.1.4 && \ - gem install bundler -v 2.1.4 +RUN gem update --system 3.3.22 && \ + gem install bundler -v 2.3.22 # Entrypoint script will install gems. COPY docker-entrypoint.sh docker-entrypoint.sh diff --git a/Gemfile b/Gemfile index 0af7d303..7cacec1c 100644 --- a/Gemfile +++ b/Gemfile @@ -33,10 +33,8 @@ group :development, :test do gem "test-unit" end - # Minimum Ruby version for Standard. That said the old - # versions of Standard might not support all the features - # such as the to-do file. - if RUBY_VERSION >= "2.2.0" - gem "standard" + # REM + if RUBY_VERSION >= "2.6" + gem "standard", git: "https://github.com/corgibytes/standard", ref: "64ddc304a5df706ede8bbbb3b0483cc67ee65a4a" end end diff --git a/GitReleaseManager.yml b/GitReleaseManager.yml new file mode 100644 index 00000000..86804ee9 --- /dev/null +++ b/GitReleaseManager.yml @@ -0,0 +1,32 @@ +issue-labels-include: + - bug + - devops + - dependencies + - documentation + - enhancement + - security + +issue-labels-alias: + - name: bug + header: Bug + plural: Bugs + + - name: dependencies + header: Dependencies + plural: Dependencies + + - name: devops + header: DevOps + plural: DevOps + + - name: documentation + header: Documentation + plural: Documentation + + - name: enhancement + header: Enhancement + plural: Enhancements + + - name: security + header: Security + plural: Security \ No newline at end of file diff --git a/GitVersion.yml b/GitVersion.yml index 62858ac8..17c7ef87 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,15 +1,83 @@ +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +assembly-informational-format: '{InformationalVersion}' +mode: ContinuousDelivery +increment: Inherit +continuous-delivery-fallback-tag: ci +tag-prefix: '[vV]' +major-version-bump-message: '\+semver:\s?(breaking|major)' +minor-version-bump-message: '\+semver:\s?(feature|minor)' +patch-version-bump-message: '\+semver:\s?(fix|patch)' +no-bump-message: '\+semver:\s?(none|skip)' +legacy-semver-padding: 4 +build-metadata-padding: 4 +commits-since-version-source-padding: 4 +tag-pre-release-weight: 60000 +commit-message-incrementing: Enabled +ignore: + sha: [ ] +merge-message-formats: {} +update-build-number: true + branches: main: + regex: ^master$|^main$ mode: ContinuousDeployment tag: alpha - increment: Minor + increment: Patch prevent-increment-of-merged-branch-version: false track-merge-target: true + source-branches: [ ] + tracks-release-branches: true + is-release-branch: false + is-mainline: false + pre-release-weight: 0 release: + regex: ^releases?[/-] + mode: ContinuousDeployment tag: beta - increment: Patch + increment: None prevent-increment-of-merged-branch-version: true track-merge-target: false -ignore: - sha: [] -merge-message-formats: {} \ No newline at end of file + source-branches: [ 'main' ] + tracks-release-branches: false + is-release-branch: true + is-mainline: false + pre-release-weight: 30000 + feature: + regex: ^features?[/-] + mode: ContinuousDelivery + tag: useBranchName + increment: Inherit + prevent-increment-of-merged-branch-version: false + track-merge-target: false + source-branches: [ 'main', 'release' ] + tracks-release-branches: false + is-release-branch: false + is-mainline: false + pre-release-weight: 30000 + pull-request: + regex: ^(pull|pull\-requests|pr)[/-] + mode: ContinuousDelivery + tag: PullRequest + increment: Inherit + prevent-increment-of-merged-branch-version: false + tag-number-pattern: '[/-](?\d+)[-/]' + track-merge-target: false + source-branches: [ 'main', 'release', 'hotfix' ] + tracks-release-branches: false + is-release-branch: false + is-mainline: false + pre-release-weight: 30000 + hotfix: + regex: ^hotfix(es)?[/-] + mode: ContinuousDelivery + tag: useBranchName + increment: Inherit + prevent-increment-of-merged-branch-version: false + track-merge-target: false + source-branches: [ 'release' ] + tracks-release-branches: false + is-release-branch: false + is-mainline: false + pre-release-weight: 30000 \ No newline at end of file diff --git a/README.md b/README.md index b026628a..864eb710 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ docker-compose build Then run the container: ```bash -docker-compose run app bash +docker-compose run --rm app bash ``` Note: The gems are not installed until the container is run and the [docker-entrypoint.sh](docker-entrypoint.sh) is called. diff --git a/lib/ruby-debug-ide.rb b/lib/ruby-debug-ide.rb index 5828df93..24f68ede 100644 --- a/lib/ruby-debug-ide.rb +++ b/lib/ruby-debug-ide.rb @@ -27,7 +27,6 @@ def find_free_port(host) # Loop over each port until we find an open port. possible_port_numbers.each do |ppn| - # rubocop: disable Style/RedundantBegin begin print_debug("Checking if port is free: #{ppn}\n") @@ -43,7 +42,6 @@ def find_free_port(host) # another port. print_debug("Port #{ppn} is in use.\n") end - # rubocop: enable Style/RedundantBegin end # Tried all the ports and couldn't find a free one. @@ -164,7 +162,6 @@ def _start_control_common(host, port, socket_path, notify_dispatcher) return if @control_thread @control_thread = DebugThread.new do - # rubocop: disable Style/RedundantBegin begin if socket_path.nil? # 127.0.0.1 seemingly works with all systems and with IPv6 as well. @@ -213,7 +210,6 @@ def _start_control_common(host, port, socket_path, notify_dispatcher) $stderr.printf "Fatal exception in DebugThread loop: #{$!.message}\nBacktrace:\n#{bt ? bt.join("\n from: ") : ""}\n" exit 2 end - # rubocop: enable Style/RedundantBegin end end diff --git a/lib/ruby-debug-ide/attach/gdb.rb b/lib/ruby-debug-ide/attach/gdb.rb index bf9085c0..47295cd0 100644 --- a/lib/ruby-debug-ide/attach/gdb.rb +++ b/lib/ruby-debug-ide/attach/gdb.rb @@ -1,11 +1,6 @@ require 'ruby-debug-ide/attach/native_debugger' class GDB < NativeDebugger - - def initialize(executable, pid, flags, gems_to_include, debugger_loader_path, argv) - super(executable, pid, flags, gems_to_include, debugger_loader_path, argv) - end - def set_flags execute 'set scheduler-locking off' # we will deadlock with it execute 'set unwindonsignal on' # in case of some signal we will exit gdb diff --git a/lib/ruby-debug-ide/attach/lldb.rb b/lib/ruby-debug-ide/attach/lldb.rb index b9bdc312..13bb46fb 100644 --- a/lib/ruby-debug-ide/attach/lldb.rb +++ b/lib/ruby-debug-ide/attach/lldb.rb @@ -1,11 +1,6 @@ require 'ruby-debug-ide/attach/native_debugger' class LLDB < NativeDebugger - - def initialize(executable, pid, flags, gems_to_include, debugger_loader_path, argv) - super(executable, pid, flags, gems_to_include, debugger_loader_path, argv) - end - def set_flags end diff --git a/ruby-debug-ide.gemspec b/ruby-debug-ide.gemspec index 5b831592..8ed89d65 100644 --- a/ruby-debug-ide.gemspec +++ b/ruby-debug-ide.gemspec @@ -55,5 +55,4 @@ EOF end spec.required_ruby_version = '>= 1.8.2' - spec.date = DateTime.now end