Skip to content

Commit

Permalink
Merge pull request #22 from Shipyrd/commit-message
Browse files Browse the repository at this point in the history
Commit message
  • Loading branch information
nickhammond committed May 13, 2024
2 parents 20f1355 + 8c99960 commit 25726dc
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/controllers/deploys_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def deploy_params
:recorded_at,
:status,
:performer,
:commit_message,
:version,
:service_version,
:service,
Expand Down
4 changes: 4 additions & 0 deletions app/views/applications/_application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
</label>

<progress class="<%= color %>" id="status" max="4" value="<%= deploy.progress_value %>"></progress>

<small>
<em><%= deploy.commit_message %></em>
</small>
</p>

<aside class="aside_naked">
Expand Down
8 changes: 4 additions & 4 deletions config/brakeman.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
{
"warning_type": "Mass Assignment",
"warning_code": 105,
"fingerprint": "1ccab913b33d7ba28d278629025289448792278e2b061e5ea8399948c5e6a365",
"fingerprint": "a530199ab745c10ef46d9af6485a3b454957b6774e4134ffa61bbdab36ded5ae",
"check_name": "PermitAttributes",
"message": "Potentially dangerous key allowed for mass assignment",
"file": "app/controllers/deploys_controller.rb",
"line": 31,
"line": 32,
"link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/",
"code": "params.require(:deploy).permit(:recorded_at, :status, :performer, :version, :service_version, :service, :hosts, :command, :subcommand, :destination, :role, :runtime)",
"code": "params.require(:deploy).permit(:recorded_at, :status, :performer, :commit_message, :version, :service_version, :service, :hosts, :command, :subcommand, :destination, :role, :runtime)",
"render_path": null,
"location": {
"type": "method",
Expand All @@ -24,6 +24,6 @@
"note": ""
}
],
"updated": "2024-05-13 15:26:40 -0700",
"updated": "2024-05-13 15:52:09 -0700",
"brakeman_version": "6.1.2"
}
1 change: 1 addition & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
config.action_controller.action_on_unpermitted_parameters = :raise

# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for development
Expand Down
1 change: 1 addition & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
config.action_controller.action_on_unpermitted_parameters = :raise

# While tests run files are not watched, reloading is not necessary.
config.enable_reloading = false
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20240513224616_add_commit_message_to_deploys.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddCommitMessageToDeploys < ActiveRecord::Migration[7.1]
def change
add_column :deploys, :commit_message, :string
end
end
3 changes: 2 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/controllers/deploys_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class DeploysControllerTest < ActionDispatch::IntegrationTest
subcommand: "exec",
recorded_at: Time.zone.now,
performer: "nick",
commit_message: "New fancy things",
version: "123456",
service_version: "potato@123456",
status: "pre-build",
Expand Down
4 changes: 3 additions & 1 deletion test/system/applications_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ class ApplicationsTest < ApplicationSystemTestCase
command: :deploy,
status: "post-deploy",
version: "123456",
performer: "Nick"
performer: "Nick",
commit_message: "Deploying the potato"
)

assert_content "post-deploy"
assert_content "by Nick"
assert_content "Deploying the potato"

create(
:deploy,
Expand Down

0 comments on commit 25726dc

Please sign in to comment.