From 20f7c1f2ac41f5e1dcba977dc88d3bdb4f92dbcb Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Wed, 16 Oct 2024 09:54:46 -0400 Subject: [PATCH 01/18] Modify PR template body and create github action to add Jira issue --- .github/PULL_REQUEST_TEMPLATE.md | 23 +++----------- .github/workflows/update-pr-template.yml | 38 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/update-pr-template.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 011b7887..348d7710 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,20 +1,5 @@ -Fixes #issuenumber ; refs #issuenumber +### Link to Jira Issue +[Link will be automatically added here. Do not remove.] -Present short summary (50 characters or less) - -More detailed description, if necessary. Try to be as descriptive as you can: even if you think that the PR content is obvious, it may not be obvious to others. Include tracebacks if helpful, and be sure to call out any bits of the PR that may be work-in-progress. - -Description can have multiple paragraphs and you can use code examples inside: - -``` ruby -class PostsController - def index - respond_with Post.limit(10) - end -end -``` - -Changes proposed in this pull request: -* -* -* +### Description + diff --git a/.github/workflows/update-pr-template.yml b/.github/workflows/update-pr-template.yml new file mode 100644 index 00000000..f6fa966f --- /dev/null +++ b/.github/workflows/update-pr-template.yml @@ -0,0 +1,38 @@ +name: Update Pull Request with Jira Issue Link + +on: + pull_request: + types: [opened, edited] + +jobs: + update-pr: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Extract Jira Issue from branch name + run: | + branch_name=$(echo "${{ github.event.pull_request.head.ref }}" | grep -oE 'LIBAAEC-[0-9]+') + if [ -z "$branch_name" ]; then + echo "No Jira issue found in branch name." + exit 0 + fi + jira_link="https://ucdts.atlassian.net/browse/$branch_name" + placeholder_exists=$(echo "${{ github.event.pull_request.body }}" | grep -c '\[Link will be automatically added here. Do not remove.\]') + + if [ "$placeholder_exists" -eq 1 ]; then + # If the placeholder exists, replace it with the Jira link + pr_body=$(echo "${{ github.event.pull_request.body }}" | sed "s|\[Link will be automatically added here. Do not remove.\]|[$branch_name]($jira_link)|") + else + # If the placeholder is missing, append the Jira link to the top of the PR description + pr_body="### Link to Jira Issue\n[$branch_name]($jira_link)\n\n${{ github.event.pull_request.body }}" + fi + echo "$pr_body" > pr_body.txt + + - name: Update Pull Request Description + uses: peter-evans/repository-dispatch@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + event-type: pull-request-edited + client-payload: '{"pull_request_number": ${{ github.event.pull_request.number }}, "pr_body": "$(cat pr_body.txt)"}' From 0cf7ee47e701d40463f5f6d2e4d5ecb3f7d4fabc Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Wed, 16 Oct 2024 10:27:51 -0400 Subject: [PATCH 02/18] Add github action to update PR title --- .github/workflows/update-pr-title.yml | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/update-pr-title.yml diff --git a/.github/workflows/update-pr-title.yml b/.github/workflows/update-pr-title.yml new file mode 100644 index 00000000..e674bbee --- /dev/null +++ b/.github/workflows/update-pr-title.yml @@ -0,0 +1,34 @@ +name: Update PR Title with Jira Issue + +on: + pull_request: + types: [opened, edited, synchronize] + +jobs: + update-pr-title: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Extract Jira Issue from Branch Name + run: | + branch_name=$(echo "${{ github.event.pull_request.head.ref }}" | grep -oE 'LIBAAEC-[0-9]+') + if [ -z "$branch_name" ]; then + echo "No Jira issue found in branch name." + exit 0 + fi + current_title="${{ github.event.pull_request.title }}" + new_title="$branch_name $current_title" + + # Check if the current title already contains the Jira issue + if [[ "$current_title" =~ $branch_name ]]; then + echo "PR title already contains the Jira issue." + exit 0 + fi + + # Update the PR title using GitHub API + echo "Updating PR title to: $new_title" + curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -d "{\"title\":\"$new_title\"}" \ + "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" From c69562e7ff4a61668753b3489dc1f400efc25b68 Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Wed, 16 Oct 2024 10:38:16 -0400 Subject: [PATCH 03/18] Fix Github automation error --- .github/workflows/update-pr-title.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-pr-title.yml b/.github/workflows/update-pr-title.yml index e674bbee..8d82c23b 100644 --- a/.github/workflows/update-pr-title.yml +++ b/.github/workflows/update-pr-title.yml @@ -14,15 +14,17 @@ jobs: - name: Extract Jira Issue from Branch Name run: | branch_name=$(echo "${{ github.event.pull_request.head.ref }}" | grep -oE 'LIBAAEC-[0-9]+') + if [ -z "$branch_name" ]; then echo "No Jira issue found in branch name." exit 0 fi + current_title="${{ github.event.pull_request.title }}" new_title="$branch_name $current_title" # Check if the current title already contains the Jira issue - if [[ "$current_title" =~ $branch_name ]]; then + if [[ "$current_title" == *"$branch_name"* ]]; then echo "PR title already contains the Jira issue." exit 0 fi From 076c5f94447a94369c9d6207fd635e177fdea9c1 Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Wed, 16 Oct 2024 12:49:06 -0400 Subject: [PATCH 04/18] Break up large run blocks in github actions, fix flaky test --- .github/workflows/update-pr-template.yml | 23 +++++++++++--- .github/workflows/update-pr-title.yml | 31 +++++++++++++------ .../other_college_field_manipulation_spec.rb | 9 ++---- 3 files changed, 43 insertions(+), 20 deletions(-) diff --git a/.github/workflows/update-pr-template.yml b/.github/workflows/update-pr-template.yml index f6fa966f..520fac90 100644 --- a/.github/workflows/update-pr-template.yml +++ b/.github/workflows/update-pr-template.yml @@ -7,11 +7,13 @@ on: jobs: update-pr: runs-on: ubuntu-latest + steps: - name: Check out code uses: actions/checkout@v3 - name: Extract Jira Issue from branch name + id: extract_branch run: | branch_name=$(echo "${{ github.event.pull_request.head.ref }}" | grep -oE 'LIBAAEC-[0-9]+') if [ -z "$branch_name" ]; then @@ -19,20 +21,31 @@ jobs: exit 0 fi jira_link="https://ucdts.atlassian.net/browse/$branch_name" + echo "::set-output name=branch_name::$branch_name" + echo "::set-output name=jira_link::$jira_link" + + - name: Check if placeholder exists in PR body + id: check_placeholder + run: | placeholder_exists=$(echo "${{ github.event.pull_request.body }}" | grep -c '\[Link will be automatically added here. Do not remove.\]') - - if [ "$placeholder_exists" -eq 1 ]; then + echo "::set-output name=placeholder_exists::$placeholder_exists" + + - name: Prepare PR body with Jira link + id: prepare_pr_body + run: | + if [ "${{ steps.check_placeholder.outputs.placeholder_exists }}" -eq 1 ]; then # If the placeholder exists, replace it with the Jira link - pr_body=$(echo "${{ github.event.pull_request.body }}" | sed "s|\[Link will be automatically added here. Do not remove.\]|[$branch_name]($jira_link)|") + pr_body=$(echo "${{ github.event.pull_request.body }}" | sed "s|\[Link will be automatically added here. Do not remove.\]|[${{ steps.extract_branch.outputs.branch_name }}](${{ steps.extract_branch.outputs.jira_link }})|") else # If the placeholder is missing, append the Jira link to the top of the PR description - pr_body="### Link to Jira Issue\n[$branch_name]($jira_link)\n\n${{ github.event.pull_request.body }}" + pr_body="### Link to Jira Issue\n[${{ steps.extract_branch.outputs.branch_name }}](${{ steps.extract_branch.outputs.jira_link }})\n\n${{ github.event.pull_request.body }}" fi echo "$pr_body" > pr_body.txt + echo "::set-output name=pr_body::$pr_body" - name: Update Pull Request Description uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.GITHUB_TOKEN }} event-type: pull-request-edited - client-payload: '{"pull_request_number": ${{ github.event.pull_request.number }}, "pr_body": "$(cat pr_body.txt)"}' + client-payload: '{"pull_request_number": ${{ github.event.pull_request.number }}, "pr_body": "${{ steps.prepare_pr_body.outputs.pr_body }}"}' diff --git a/.github/workflows/update-pr-title.yml b/.github/workflows/update-pr-title.yml index 8d82c23b..1d0105ed 100644 --- a/.github/workflows/update-pr-title.yml +++ b/.github/workflows/update-pr-title.yml @@ -7,29 +7,42 @@ on: jobs: update-pr-title: runs-on: ubuntu-latest + steps: - name: Check out code uses: actions/checkout@v3 - - name: Extract Jira Issue from Branch Name + - name: Extract Jira issue from branch name + id: extract_branch run: | branch_name=$(echo "${{ github.event.pull_request.head.ref }}" | grep -oE 'LIBAAEC-[0-9]+') - if [ -z "$branch_name" ]; then echo "No Jira issue found in branch name." exit 0 fi - + echo "::set-output name=branch_name::$branch_name" + + - name: Get current PR title + id: get_title + run: | current_title="${{ github.event.pull_request.title }}" - new_title="$branch_name $current_title" - - # Check if the current title already contains the Jira issue - if [[ "$current_title" == *"$branch_name"* ]]; then + echo "::set-output name=current_title::$current_title" + + - name: Check if Jira issue is already in PR title + run: | + if [[ "${{ steps.get_title.outputs.current_title }}" == *"${{ steps.extract_branch.outputs.branch_name }}"* ]]; then echo "PR title already contains the Jira issue." exit 0 fi - - # Update the PR title using GitHub API + + - name: Prepend Jira issue to PR title + run: | + new_title="${{ steps.extract_branch.outputs.branch_name }} ${{ steps.get_title.outputs.current_title }}" + echo "::set-output name=new_title::$new_title" + + - name: Update PR title with Jira issue + run: | + new_title="${{ steps.prepend_issue.outputs.new_title }}" echo "Updating PR title to: $new_title" curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -d "{\"title\":\"$new_title\"}" \ diff --git a/spec/features/publication_creation/other_college_field_manipulation_spec.rb b/spec/features/publication_creation/other_college_field_manipulation_spec.rb index 087cae4e..c4cb16a9 100644 --- a/spec/features/publication_creation/other_college_field_manipulation_spec.rb +++ b/spec/features/publication_creation/other_college_field_manipulation_spec.rb @@ -32,24 +32,21 @@ context 'When selecting Other college' do it 'toggles the Other College text field' do other_checkbox = all('input[type="checkbox"]').last - other_college_field = find('#other_college_group', visible: :all) # Finds even if invisible # Initially, the Other College field should not be visible - expect(other_college_field).not_to be_visible + expect(page).to have_selector('#other_college_group', visible: false) # Select the Other checkbox other_checkbox.set(true) # Now, the Other College field should be visible - expect(page).to have_selector('input[type="checkbox"]:checked', count: 1) - expect(page).to have_text('Other College') - expect(other_college_field).to be_visible + expect(page).to have_selector('#other_college_group', visible: true) # Unselect the Other checkbox other_checkbox.set(false) # The Other College field should not be visible again - expect(other_college_field).not_to be_visible + expect(page).to have_selector('#other_college_group', visible: false) end it 'allows user to select Other college without filling in the Other name' do From e947b22156292e2a78adec5399a347443b7d39f3 Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Wed, 16 Oct 2024 13:00:31 -0400 Subject: [PATCH 05/18] Update github action to use new Environment file --- .github/workflows/update-pr-template.yml | 29 ++++++++++++------------ .github/workflows/update-pr-title.yml | 8 +++---- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/update-pr-template.yml b/.github/workflows/update-pr-template.yml index 520fac90..59a74720 100644 --- a/.github/workflows/update-pr-template.yml +++ b/.github/workflows/update-pr-template.yml @@ -21,31 +21,32 @@ jobs: exit 0 fi jira_link="https://ucdts.atlassian.net/browse/$branch_name" - echo "::set-output name=branch_name::$branch_name" - echo "::set-output name=jira_link::$jira_link" + echo "branch_name=$branch_name" >> $GITHUB_OUTPUT + echo "jira_link=$jira_link" >> $GITHUB_OUTPUT - name: Check if placeholder exists in PR body id: check_placeholder run: | placeholder_exists=$(echo "${{ github.event.pull_request.body }}" | grep -c '\[Link will be automatically added here. Do not remove.\]') - echo "::set-output name=placeholder_exists::$placeholder_exists" + echo "placeholder_exists=$placeholder_exists" >> $GITHUB_OUTPUT - - name: Prepare PR body with Jira link - id: prepare_pr_body + - name: Replace placeholder in PR body with Jira link + if: steps.check_placeholder.outputs.placeholder_exists == '1' run: | - if [ "${{ steps.check_placeholder.outputs.placeholder_exists }}" -eq 1 ]; then - # If the placeholder exists, replace it with the Jira link - pr_body=$(echo "${{ github.event.pull_request.body }}" | sed "s|\[Link will be automatically added here. Do not remove.\]|[${{ steps.extract_branch.outputs.branch_name }}](${{ steps.extract_branch.outputs.jira_link }})|") - else - # If the placeholder is missing, append the Jira link to the top of the PR description - pr_body="### Link to Jira Issue\n[${{ steps.extract_branch.outputs.branch_name }}](${{ steps.extract_branch.outputs.jira_link }})\n\n${{ github.event.pull_request.body }}" - fi + pr_body=$(echo "${{ github.event.pull_request.body }}" | sed "s|\[Link will be automatically added here. Do not remove.\]|[${{ steps.extract_branch.outputs.branch_name }}](${{ steps.extract_branch.outputs.jira_link }})|") + echo "$pr_body" > pr_body.txt + echo "pr_body=$pr_body" >> $GITHUB_OUTPUT + + - name: Append Jira link to top of PR body + if: steps.check_placeholder.outputs.placeholder_exists != '1' + run: | + pr_body="### Link to Jira Issue\n[${{ steps.extract_branch.outputs.branch_name }}](${{ steps.extract_branch.outputs.jira_link }})\n\n${{ github.event.pull_request.body }}" echo "$pr_body" > pr_body.txt - echo "::set-output name=pr_body::$pr_body" + echo "pr_body=$pr_body" >> $GITHUB_OUTPUT - name: Update Pull Request Description uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.GITHUB_TOKEN }} event-type: pull-request-edited - client-payload: '{"pull_request_number": ${{ github.event.pull_request.number }}, "pr_body": "${{ steps.prepare_pr_body.outputs.pr_body }}"}' + client-payload: '{"pull_request_number": ${{ github.event.pull_request.number }}, "pr_body": "${{ steps.append_pr_body.outputs.pr_body }}"}' diff --git a/.github/workflows/update-pr-title.yml b/.github/workflows/update-pr-title.yml index 1d0105ed..bd9ad7f0 100644 --- a/.github/workflows/update-pr-title.yml +++ b/.github/workflows/update-pr-title.yml @@ -20,13 +20,13 @@ jobs: echo "No Jira issue found in branch name." exit 0 fi - echo "::set-output name=branch_name::$branch_name" + echo "branch_name=$branch_name" >> $GITHUB_OUTPUT - name: Get current PR title id: get_title run: | current_title="${{ github.event.pull_request.title }}" - echo "::set-output name=current_title::$current_title" + echo "current_title=$current_title" >> $GITHUB_OUTPUT - name: Check if Jira issue is already in PR title run: | @@ -36,14 +36,14 @@ jobs: fi - name: Prepend Jira issue to PR title + id: prepend_issue run: | new_title="${{ steps.extract_branch.outputs.branch_name }} ${{ steps.get_title.outputs.current_title }}" - echo "::set-output name=new_title::$new_title" + echo "new_title=$new_title" >> $GITHUB_OUTPUT - name: Update PR title with Jira issue run: | new_title="${{ steps.prepend_issue.outputs.new_title }}" - echo "Updating PR title to: $new_title" curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -d "{\"title\":\"$new_title\"}" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" From 54153d592231a133e56c36ca80629777a985492b Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Wed, 16 Oct 2024 13:10:02 -0400 Subject: [PATCH 06/18] Fix flaky tests --- .../other_college_field_manipulation_spec.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/spec/features/publication_creation/other_college_field_manipulation_spec.rb b/spec/features/publication_creation/other_college_field_manipulation_spec.rb index c4cb16a9..d4824471 100644 --- a/spec/features/publication_creation/other_college_field_manipulation_spec.rb +++ b/spec/features/publication_creation/other_college_field_manipulation_spec.rb @@ -18,9 +18,13 @@ it 'selects an already listed college' do within '#colleges-group' do - all('input[type="checkbox"]')[1].set(true) # Array is zero-indexed + # Find and explicitly check the second checkbox + checkbox = all('input[type="checkbox"]')[1] + checkbox.set(true) + + # Explicitly wait for the checkbox to be checked + expect(checkbox).to be_checked end - expect(page).to have_selector('input[type="checkbox"]:checked', count: 1) click_on('Submit') expect(page).to have_current_path(Rails.application.routes.url_helpers.publications_path) @@ -52,10 +56,14 @@ it 'allows user to select Other college without filling in the Other name' do # The "Other" college is the last checkbox in the Colleges group within '#colleges-group' do - all('input[type="checkbox"]').last.set(true) + # Find and explicitly check the last checkbox + checkbox = all('input[type="checkbox"]').last + checkbox.set(true) + + # Explicitly wait for the last checkbox to be checked + expect(checkbox).to be_checked end - expect(page).to have_selector('input[type="checkbox"]:checked', count: 1) click_on('Submit') expect(page).to have_current_path(Rails.application.routes.url_helpers.publications_path) From ea7f73b2d320c0fea2a885c55841fbcf0d1e4824 Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Wed, 16 Oct 2024 13:19:18 -0400 Subject: [PATCH 07/18] Correct multiple title updates --- .github/workflows/update-pr-title.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-pr-title.yml b/.github/workflows/update-pr-title.yml index bd9ad7f0..959413ea 100644 --- a/.github/workflows/update-pr-title.yml +++ b/.github/workflows/update-pr-title.yml @@ -29,19 +29,23 @@ jobs: echo "current_title=$current_title" >> $GITHUB_OUTPUT - name: Check if Jira issue is already in PR title + id: check_title run: | - if [[ "${{ steps.get_title.outputs.current_title }}" == *"${{ steps.extract_branch.outputs.branch_name }}"* ]]; then + if echo "${{ steps.get_title.outputs.current_title }}" | grep -q "${{ steps.extract_branch.outputs.branch_name }}"; then echo "PR title already contains the Jira issue." - exit 0 - fi + echo "skip_update=true" >> $GITHUB_OUTPUT + else + echo "skip_update=false" >> $GITHUB_OUTPUT - name: Prepend Jira issue to PR title id: prepend_issue + if: steps.check_title.outputs.skip_update == 'false' run: | new_title="${{ steps.extract_branch.outputs.branch_name }} ${{ steps.get_title.outputs.current_title }}" echo "new_title=$new_title" >> $GITHUB_OUTPUT - name: Update PR title with Jira issue + if: steps.check_title.outputs.skip_update == 'false' run: | new_title="${{ steps.prepend_issue.outputs.new_title }}" curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ From 4a3f005e57cc600e39dd5033190e57a8472bf964 Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Wed, 16 Oct 2024 13:22:57 -0400 Subject: [PATCH 08/18] Fix syntax error of unclosed if/else statement in yml file --- .github/workflows/update-pr-title.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-pr-title.yml b/.github/workflows/update-pr-title.yml index 959413ea..2150ae68 100644 --- a/.github/workflows/update-pr-title.yml +++ b/.github/workflows/update-pr-title.yml @@ -36,6 +36,7 @@ jobs: echo "skip_update=true" >> $GITHUB_OUTPUT else echo "skip_update=false" >> $GITHUB_OUTPUT + fi - name: Prepend Jira issue to PR title id: prepend_issue From 334111cf888a15918a9fbc91de5513808172710c Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Wed, 16 Oct 2024 14:18:33 -0400 Subject: [PATCH 09/18] Simplify adding jira issue, add clarifying comments, fix errors --- .github/PULL_REQUEST_TEMPLATE.md | 5 --- .github/workflows/update-pr-template.yml | 55 +++++++++++++----------- .github/workflows/update-pr-title.yml | 29 +++++++++---- 3 files changed, 51 insertions(+), 38 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 348d7710..00000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,5 +0,0 @@ -### Link to Jira Issue -[Link will be automatically added here. Do not remove.] - -### Description - diff --git a/.github/workflows/update-pr-template.yml b/.github/workflows/update-pr-template.yml index 59a74720..d0e352fd 100644 --- a/.github/workflows/update-pr-template.yml +++ b/.github/workflows/update-pr-template.yml @@ -15,38 +15,43 @@ jobs: - name: Extract Jira Issue from branch name id: extract_branch run: | - branch_name=$(echo "${{ github.event.pull_request.head.ref }}" | grep -oE 'LIBAAEC-[0-9]+') + echo "Extracting Jira issue from branch name..." + branch_name=$(echo "${{ github.event.pull_request.head.ref }}" | grep -oEi 'LIBAAEC-[0-9]+') if [ -z "$branch_name" ]; then - echo "No Jira issue found in branch name." + echo "No Jira issue found in branch name. Exiting." exit 0 fi jira_link="https://ucdts.atlassian.net/browse/$branch_name" + echo "Extracted Jira Issue: $branch_name" + echo "Generated Jira Link: $jira_link" echo "branch_name=$branch_name" >> $GITHUB_OUTPUT echo "jira_link=$jira_link" >> $GITHUB_OUTPUT - - name: Check if placeholder exists in PR body - id: check_placeholder + - name: Check if Jira link exists in PR body + id: check_jira_link run: | - placeholder_exists=$(echo "${{ github.event.pull_request.body }}" | grep -c '\[Link will be automatically added here. Do not remove.\]') - echo "placeholder_exists=$placeholder_exists" >> $GITHUB_OUTPUT - - - name: Replace placeholder in PR body with Jira link - if: steps.check_placeholder.outputs.placeholder_exists == '1' - run: | - pr_body=$(echo "${{ github.event.pull_request.body }}" | sed "s|\[Link will be automatically added here. Do not remove.\]|[${{ steps.extract_branch.outputs.branch_name }}](${{ steps.extract_branch.outputs.jira_link }})|") - echo "$pr_body" > pr_body.txt - echo "pr_body=$pr_body" >> $GITHUB_OUTPUT + jira_link="${{ steps.extract_branch.outputs.jira_link }}" + echo "Checking if Jira link exists in the PR body..." + jira_link_present=$(echo "${{ github.event.pull_request.body || '' }}" | grep -c "$jira_link") + if [ "$jira_link_present" -eq 1 ]; then + echo "Jira link already exists in the PR body." + echo "skip_update=true" >> $GITHUB_OUTPUT + else + echo "Jira link does not exist in the PR body." + echo "skip_update=false" >> $GITHUB_OUTPUT + fi - - name: Append Jira link to top of PR body - if: steps.check_placeholder.outputs.placeholder_exists != '1' + - name: Prepend Jira link and update PR description + if: steps.check_jira_link.outputs.skip_update == 'false' run: | - pr_body="### Link to Jira Issue\n[${{ steps.extract_branch.outputs.branch_name }}](${{ steps.extract_branch.outputs.jira_link }})\n\n${{ github.event.pull_request.body }}" - echo "$pr_body" > pr_body.txt - echo "pr_body=$pr_body" >> $GITHUB_OUTPUT - - - name: Update Pull Request Description - uses: peter-evans/repository-dispatch@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - event-type: pull-request-edited - client-payload: '{"pull_request_number": ${{ github.event.pull_request.number }}, "pr_body": "${{ steps.append_pr_body.outputs.pr_body }}"}' + echo "Prepending Jira link to PR body..." + jira_link="Jira Issue: [${{ steps.extract_branch.outputs.branch_name }}](${{ steps.extract_branch.outputs.jira_link }})" + original_body="${{ github.event.pull_request.body || '' }}" + pr_body="$jira_link"$'\n\n'"$original_body" + pr_body_escaped=$(echo "$pr_body" | jq -Rs .) + + echo "Sending updated PR body to GitHub..." + curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -d "{\"body\": $pr_body_escaped}" \ + "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" + echo "PR body updated successfully." diff --git a/.github/workflows/update-pr-title.yml b/.github/workflows/update-pr-title.yml index 2150ae68..137cd9b0 100644 --- a/.github/workflows/update-pr-title.yml +++ b/.github/workflows/update-pr-title.yml @@ -13,28 +13,34 @@ jobs: uses: actions/checkout@v3 - name: Extract Jira issue from branch name - id: extract_branch + id: extract_jira_issue run: | - branch_name=$(echo "${{ github.event.pull_request.head.ref }}" | grep -oE 'LIBAAEC-[0-9]+') - if [ -z "$branch_name" ]; then - echo "No Jira issue found in branch name." + echo "Extracting Jira issue from branch name..." + jira_issue=$(echo "${{ github.event.pull_request.head.ref }}" | grep -oE 'LIBAAEC-[0-9]+' | tr '[:lower:]' '[:upper:]') + if [ -z "$jira_issue" ]; then + echo "No Jira issue found in branch name. Exiting." exit 0 fi - echo "branch_name=$branch_name" >> $GITHUB_OUTPUT + echo "Extracted Jira Issue: $jira_issue" + echo "jira_issue=$jira_issue" >> $GITHUB_OUTPUT - name: Get current PR title id: get_title run: | + echo "Retrieving current PR title..." current_title="${{ github.event.pull_request.title }}" + echo "Current PR title: $current_title" echo "current_title=$current_title" >> $GITHUB_OUTPUT - name: Check if Jira issue is already in PR title id: check_title run: | - if echo "${{ steps.get_title.outputs.current_title }}" | grep -q "${{ steps.extract_branch.outputs.branch_name }}"; then + echo "Checking if Jira issue is already in PR title..." + if echo "${{ steps.get_title.outputs.current_title }}" | grep -qi "${{ steps.extract_jira_issue.outputs.jira_issue }}"; then echo "PR title already contains the Jira issue." echo "skip_update=true" >> $GITHUB_OUTPUT else + echo "Jira issue is not in the PR title." echo "skip_update=false" >> $GITHUB_OUTPUT fi @@ -42,13 +48,20 @@ jobs: id: prepend_issue if: steps.check_title.outputs.skip_update == 'false' run: | - new_title="${{ steps.extract_branch.outputs.branch_name }} ${{ steps.get_title.outputs.current_title }}" + echo "Prepending Jira issue to PR title..." + new_title="${{ steps.extract_jira_issue.outputs.jira_issue }} ${{ steps.get_title.outputs.current_title }}" + echo "New PR title: $new_title" echo "new_title=$new_title" >> $GITHUB_OUTPUT - name: Update PR title with Jira issue if: steps.check_title.outputs.skip_update == 'false' run: | new_title="${{ steps.prepend_issue.outputs.new_title }}" + echo "Updating PR title with new title: $new_title" curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -d "{\"title\":\"$new_title\"}" \ - "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" + "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" || { + echo "Error: Failed to update PR title." + exit 1 + } + echo "PR title updated successfully." From 605fc65d07bd03133c4d10338bedf66063452711 Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Wed, 16 Oct 2024 16:28:32 -0400 Subject: [PATCH 10/18] fix flaky test --- .../other_college_field_manipulation_spec.rb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/spec/features/publication_creation/other_college_field_manipulation_spec.rb b/spec/features/publication_creation/other_college_field_manipulation_spec.rb index d4824471..6a032e4c 100644 --- a/spec/features/publication_creation/other_college_field_manipulation_spec.rb +++ b/spec/features/publication_creation/other_college_field_manipulation_spec.rb @@ -116,9 +116,22 @@ it 'saves both a listed college and Other college when selected' do within '#colleges-group' do - all('input[type="checkbox"]')[1].set(true) # Array is zero-indexed - all('input[type="checkbox"]').last.set(true) + # Select the second checkbox and set it to true + checkbox1 = all('input[type="checkbox"]')[1] + checkbox1.set(true) + + # Explicitly wait for the checkbox to be checked + expect(checkbox1).to be_checked + + # Select the last checkbox and set it to true + checkbox2 = all('input[type="checkbox"]').last + checkbox2.set(true) + + # Explicitly wait for the last checkbox to be checked + expect(checkbox2).to be_checked end + + # Ensure there are exactly 2 checkboxes checked expect(page).to have_selector('input[type="checkbox"]:checked', count: 2) fill_in('artwork[other_college]', with: 'Other College Name') click_on('Submit') From 4cb6a1c5f7285ff607f14152c5e1b3754fdf6620 Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Wed, 16 Oct 2024 16:32:41 -0400 Subject: [PATCH 11/18] Make template github action run when commits are pushed --- .github/workflows/update-pr-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-pr-template.yml b/.github/workflows/update-pr-template.yml index d0e352fd..8c720945 100644 --- a/.github/workflows/update-pr-template.yml +++ b/.github/workflows/update-pr-template.yml @@ -2,7 +2,7 @@ name: Update Pull Request with Jira Issue Link on: pull_request: - types: [opened, edited] + types: [opened, edited, synchronize] jobs: update-pr: From d184b2c42624b2cfeba2a0206a28b980c98182b3 Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Thu, 24 Oct 2024 13:27:23 -0400 Subject: [PATCH 12/18] Correct 'Check if Jira link exists in PR body' task --- .github/workflows/update-pr-template.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-pr-template.yml b/.github/workflows/update-pr-template.yml index 8c720945..3843bb4b 100644 --- a/.github/workflows/update-pr-template.yml +++ b/.github/workflows/update-pr-template.yml @@ -30,15 +30,14 @@ jobs: - name: Check if Jira link exists in PR body id: check_jira_link run: | - jira_link="${{ steps.extract_branch.outputs.jira_link }}" echo "Checking if Jira link exists in the PR body..." - jira_link_present=$(echo "${{ github.event.pull_request.body || '' }}" | grep -c "$jira_link") - if [ "$jira_link_present" -eq 1 ]; then + jira_link="${{ steps.extract_branch.outputs.jira_link }}" + if grep -qF "$jira_link" <<< "${{ github.event.pull_request.body || '' }}"; then echo "Jira link already exists in the PR body." - echo "skip_update=true" >> $GITHUB_OUTPUT + echo "skip_update=true" >> "$GITHUB_OUTPUT" else echo "Jira link does not exist in the PR body." - echo "skip_update=false" >> $GITHUB_OUTPUT + echo "skip_update=false" >> "$GITHUB_OUTPUT" fi - name: Prepend Jira link and update PR description From 392d4a5fd5a87ef9919be93bf7610197381c2f24 Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Mon, 28 Oct 2024 09:44:14 -0400 Subject: [PATCH 13/18] Safely load PR body using jq --- .github/workflows/update-pr-template.yml | 14 +++++++++++++- .ruby-gemset | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-pr-template.yml b/.github/workflows/update-pr-template.yml index 3843bb4b..1d81a64c 100644 --- a/.github/workflows/update-pr-template.yml +++ b/.github/workflows/update-pr-template.yml @@ -12,6 +12,16 @@ jobs: - name: Check out code uses: actions/checkout@v3 + - name: Ensure jq is installed + run: | + if ! command -v jq &> /dev/null; then + echo "jq is not installed. Installing jq..." + sudo apt-get update + sudo apt-get install -y jq + else + echo "jq is already installed." + fi + - name: Extract Jira Issue from branch name id: extract_branch run: | @@ -45,8 +55,10 @@ jobs: run: | echo "Prepending Jira link to PR body..." jira_link="Jira Issue: [${{ steps.extract_branch.outputs.branch_name }}](${{ steps.extract_branch.outputs.jira_link }})" - original_body="${{ github.event.pull_request.body || '' }}" + # Safely read the original PR body using jq + original_body=$(jq -r .pull_request.body "$GITHUB_EVENT_PATH") pr_body="$jira_link"$'\n\n'"$original_body" + # Escape the updated PR body for JSON pr_body_escaped=$(echo "$pr_body" | jq -Rs .) echo "Sending updated PR body to GitHub..." diff --git a/.ruby-gemset b/.ruby-gemset index 8d6c54aa..6d8c4704 100644 --- a/.ruby-gemset +++ b/.ruby-gemset @@ -1 +1 @@ -aaec \ No newline at end of file +-global From fab9edbeb1703b3ad67192e4e1ce81bd9cd10fbd Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Fri, 22 Nov 2024 08:46:36 -0500 Subject: [PATCH 14/18] Add workflow file for jira-pr-updater --- .github/workflows/update-pr-template.yml | 68 ------------------------ .github/workflows/update-pr-title.yml | 67 ----------------------- .github/workflows/update-pr.yml | 15 ++++++ 3 files changed, 15 insertions(+), 135 deletions(-) delete mode 100644 .github/workflows/update-pr-template.yml delete mode 100644 .github/workflows/update-pr-title.yml create mode 100644 .github/workflows/update-pr.yml diff --git a/.github/workflows/update-pr-template.yml b/.github/workflows/update-pr-template.yml deleted file mode 100644 index 1d81a64c..00000000 --- a/.github/workflows/update-pr-template.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Update Pull Request with Jira Issue Link - -on: - pull_request: - types: [opened, edited, synchronize] - -jobs: - update-pr: - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@v3 - - - name: Ensure jq is installed - run: | - if ! command -v jq &> /dev/null; then - echo "jq is not installed. Installing jq..." - sudo apt-get update - sudo apt-get install -y jq - else - echo "jq is already installed." - fi - - - name: Extract Jira Issue from branch name - id: extract_branch - run: | - echo "Extracting Jira issue from branch name..." - branch_name=$(echo "${{ github.event.pull_request.head.ref }}" | grep -oEi 'LIBAAEC-[0-9]+') - if [ -z "$branch_name" ]; then - echo "No Jira issue found in branch name. Exiting." - exit 0 - fi - jira_link="https://ucdts.atlassian.net/browse/$branch_name" - echo "Extracted Jira Issue: $branch_name" - echo "Generated Jira Link: $jira_link" - echo "branch_name=$branch_name" >> $GITHUB_OUTPUT - echo "jira_link=$jira_link" >> $GITHUB_OUTPUT - - - name: Check if Jira link exists in PR body - id: check_jira_link - run: | - echo "Checking if Jira link exists in the PR body..." - jira_link="${{ steps.extract_branch.outputs.jira_link }}" - if grep -qF "$jira_link" <<< "${{ github.event.pull_request.body || '' }}"; then - echo "Jira link already exists in the PR body." - echo "skip_update=true" >> "$GITHUB_OUTPUT" - else - echo "Jira link does not exist in the PR body." - echo "skip_update=false" >> "$GITHUB_OUTPUT" - fi - - - name: Prepend Jira link and update PR description - if: steps.check_jira_link.outputs.skip_update == 'false' - run: | - echo "Prepending Jira link to PR body..." - jira_link="Jira Issue: [${{ steps.extract_branch.outputs.branch_name }}](${{ steps.extract_branch.outputs.jira_link }})" - # Safely read the original PR body using jq - original_body=$(jq -r .pull_request.body "$GITHUB_EVENT_PATH") - pr_body="$jira_link"$'\n\n'"$original_body" - # Escape the updated PR body for JSON - pr_body_escaped=$(echo "$pr_body" | jq -Rs .) - - echo "Sending updated PR body to GitHub..." - curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -d "{\"body\": $pr_body_escaped}" \ - "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" - echo "PR body updated successfully." diff --git a/.github/workflows/update-pr-title.yml b/.github/workflows/update-pr-title.yml deleted file mode 100644 index 137cd9b0..00000000 --- a/.github/workflows/update-pr-title.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Update PR Title with Jira Issue - -on: - pull_request: - types: [opened, edited, synchronize] - -jobs: - update-pr-title: - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@v3 - - - name: Extract Jira issue from branch name - id: extract_jira_issue - run: | - echo "Extracting Jira issue from branch name..." - jira_issue=$(echo "${{ github.event.pull_request.head.ref }}" | grep -oE 'LIBAAEC-[0-9]+' | tr '[:lower:]' '[:upper:]') - if [ -z "$jira_issue" ]; then - echo "No Jira issue found in branch name. Exiting." - exit 0 - fi - echo "Extracted Jira Issue: $jira_issue" - echo "jira_issue=$jira_issue" >> $GITHUB_OUTPUT - - - name: Get current PR title - id: get_title - run: | - echo "Retrieving current PR title..." - current_title="${{ github.event.pull_request.title }}" - echo "Current PR title: $current_title" - echo "current_title=$current_title" >> $GITHUB_OUTPUT - - - name: Check if Jira issue is already in PR title - id: check_title - run: | - echo "Checking if Jira issue is already in PR title..." - if echo "${{ steps.get_title.outputs.current_title }}" | grep -qi "${{ steps.extract_jira_issue.outputs.jira_issue }}"; then - echo "PR title already contains the Jira issue." - echo "skip_update=true" >> $GITHUB_OUTPUT - else - echo "Jira issue is not in the PR title." - echo "skip_update=false" >> $GITHUB_OUTPUT - fi - - - name: Prepend Jira issue to PR title - id: prepend_issue - if: steps.check_title.outputs.skip_update == 'false' - run: | - echo "Prepending Jira issue to PR title..." - new_title="${{ steps.extract_jira_issue.outputs.jira_issue }} ${{ steps.get_title.outputs.current_title }}" - echo "New PR title: $new_title" - echo "new_title=$new_title" >> $GITHUB_OUTPUT - - - name: Update PR title with Jira issue - if: steps.check_title.outputs.skip_update == 'false' - run: | - new_title="${{ steps.prepend_issue.outputs.new_title }}" - echo "Updating PR title with new title: $new_title" - curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -d "{\"title\":\"$new_title\"}" \ - "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" || { - echo "Error: Failed to update PR title." - exit 1 - } - echo "PR title updated successfully." diff --git a/.github/workflows/update-pr.yml b/.github/workflows/update-pr.yml new file mode 100644 index 00000000..279091fe --- /dev/null +++ b/.github/workflows/update-pr.yml @@ -0,0 +1,15 @@ +name: Update PR with Jira Issue +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + update-pr: + runs-on: ubuntu-latest + steps: + - name: Update PR with Jira Issue + uses: uclibs/jira-pr-updater-action@v1 + with: + jira-base-url: 'https://ucdts.atlassian.net' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 040e4949aa9f2fad87b38d3f6f12c4683737085b Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Mon, 25 Nov 2024 09:51:14 -0500 Subject: [PATCH 15/18] Update to Rails 6.1.7.10 --- Gemfile | 10 +-- Gemfile.lock | 176 ++++++++++++++++++++++++++------------------------- 2 files changed, 94 insertions(+), 92 deletions(-) diff --git a/Gemfile b/Gemfile index e0d23c73..4a6be20d 100644 --- a/Gemfile +++ b/Gemfile @@ -14,11 +14,11 @@ gem 'mutex_m' # Required for activestorage, being removed from Ruby in version 3 gem 'rexml', '>= 3.3.6' # XML parsing library, addressing bundle audit issues # Core Rails gems -gem 'actioncable', '~> 6.1.7.9' -gem 'actionmailer', '~> 6.1.7.9' -gem 'actionpack', '~> 6.1.7.9' -gem 'actiontext', '~> 6.1.7.9' -gem 'rails', '~> 6.1.7.9' +gem 'actioncable', '~> 6.1.7.10' +gem 'actionmailer', '~> 6.1.7.10' +gem 'actionpack', '~> 6.1.7.10' +gem 'actiontext', '~> 6.1.7.10' +gem 'rails', '~> 6.1.7.10' # Server and Performance gem 'puma', '>= 6.4.3' # A fast, multithreaded, and highly concurrent web server for Ruby/Rack applications diff --git a/Gemfile.lock b/Gemfile.lock index e0a85031..e099ee1e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,60 +1,60 @@ GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.9) - actionpack (= 6.1.7.9) - activesupport (= 6.1.7.9) + actioncable (6.1.7.10) + actionpack (= 6.1.7.10) + activesupport (= 6.1.7.10) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.9) - actionpack (= 6.1.7.9) - activejob (= 6.1.7.9) - activerecord (= 6.1.7.9) - activestorage (= 6.1.7.9) - activesupport (= 6.1.7.9) + actionmailbox (6.1.7.10) + actionpack (= 6.1.7.10) + activejob (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) mail (>= 2.7.1) - actionmailer (6.1.7.9) - actionpack (= 6.1.7.9) - actionview (= 6.1.7.9) - activejob (= 6.1.7.9) - activesupport (= 6.1.7.9) + actionmailer (6.1.7.10) + actionpack (= 6.1.7.10) + actionview (= 6.1.7.10) + activejob (= 6.1.7.10) + activesupport (= 6.1.7.10) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.7.9) - actionview (= 6.1.7.9) - activesupport (= 6.1.7.9) + actionpack (6.1.7.10) + actionview (= 6.1.7.10) + activesupport (= 6.1.7.10) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.9) - actionpack (= 6.1.7.9) - activerecord (= 6.1.7.9) - activestorage (= 6.1.7.9) - activesupport (= 6.1.7.9) + actiontext (6.1.7.10) + actionpack (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) nokogiri (>= 1.8.5) - actionview (6.1.7.9) - activesupport (= 6.1.7.9) + actionview (6.1.7.10) + activesupport (= 6.1.7.10) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7.9) - activesupport (= 6.1.7.9) + activejob (6.1.7.10) + activesupport (= 6.1.7.10) globalid (>= 0.3.6) - activemodel (6.1.7.9) - activesupport (= 6.1.7.9) - activerecord (6.1.7.9) - activemodel (= 6.1.7.9) - activesupport (= 6.1.7.9) - activestorage (6.1.7.9) - actionpack (= 6.1.7.9) - activejob (= 6.1.7.9) - activerecord (= 6.1.7.9) - activesupport (= 6.1.7.9) + activemodel (6.1.7.10) + activesupport (= 6.1.7.10) + activerecord (6.1.7.10) + activemodel (= 6.1.7.10) + activesupport (= 6.1.7.10) + activestorage (6.1.7.10) + actionpack (= 6.1.7.10) + activejob (= 6.1.7.10) + activerecord (= 6.1.7.10) + activesupport (= 6.1.7.10) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.9) + activesupport (6.1.7.10) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -78,14 +78,14 @@ GEM bootstrap (5.3.3) autoprefixer-rails (>= 9.1.0) popper_js (>= 2.11.8, < 3) - brakeman (6.2.1) + brakeman (6.2.2) racc builder (3.3.0) bundler-audit (0.9.2) bundler (>= 1.2.0, < 3) thor (~> 1.0) byebug (11.1.3) - capistrano (3.19.1) + capistrano (3.19.2) airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) @@ -128,7 +128,7 @@ GEM tins (~> 1.32) crass (1.0.6) csv (3.3.0) - date (3.3.4) + date (3.4.0) diff-lcs (1.5.1) docile (1.4.1) dotenv (3.1.4) @@ -138,11 +138,11 @@ GEM drb (2.2.1) ed25519 (1.3.0) erubi (1.13.0) - execjs (2.9.1) + execjs (2.10.0) factory_bot (6.5.0) activesupport (>= 5.0.0) - factory_bot_rails (6.4.3) - factory_bot (~> 6.4) + factory_bot_rails (6.4.4) + factory_bot (~> 6.5) railties (>= 5.0.0) ffi (1.17.0-aarch64-linux-gnu) ffi (1.17.0-aarch64-linux-musl) @@ -168,13 +168,13 @@ GEM thor (>= 0.14, < 2.0) jsbundling-rails (1.3.1) railties (>= 6.0.0) - json (2.7.2) + json (2.8.2) language_server-protocol (3.17.0.3) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.6.1) - loofah (2.22.0) + loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -186,11 +186,11 @@ GEM matrix (0.4.2) method_source (1.1.0) mini_mime (1.1.5) - minitest (5.25.1) - msgpack (1.7.3) - mutex_m (0.2.0) + minitest (5.25.2) + msgpack (1.7.5) + mutex_m (0.3.0) mysql2 (0.5.6) - net-imap (0.4.17) + net-imap (0.5.1) date net-protocol net-pop (0.1.2) @@ -203,7 +203,7 @@ GEM net-smtp (0.5.0) net-protocol net-ssh (7.3.0) - nio4r (2.7.3) + nio4r (2.7.4) nokogiri (1.16.7-aarch64-linux) racc (~> 1.4) nokogiri (1.16.7-arm-linux) @@ -216,34 +216,34 @@ GEM racc (~> 1.4) nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) - ostruct (0.6.0) - pagy (9.1.0) + ostruct (0.6.1) + pagy (9.3.1) parallel (1.26.3) - parser (3.3.5.0) + parser (3.3.6.0) ast (~> 2.4.1) racc popper_js (2.11.8) public_suffix (6.0.1) - puma (6.4.3) + puma (6.5.0) nio4r (~> 2.0) racc (1.8.1) rack (2.2.10) rack-test (2.1.0) rack (>= 1.3) - rails (6.1.7.9) - actioncable (= 6.1.7.9) - actionmailbox (= 6.1.7.9) - actionmailer (= 6.1.7.9) - actionpack (= 6.1.7.9) - actiontext (= 6.1.7.9) - actionview (= 6.1.7.9) - activejob (= 6.1.7.9) - activemodel (= 6.1.7.9) - activerecord (= 6.1.7.9) - activestorage (= 6.1.7.9) - activesupport (= 6.1.7.9) + rails (6.1.7.10) + actioncable (= 6.1.7.10) + actionmailbox (= 6.1.7.10) + actionmailer (= 6.1.7.10) + actionpack (= 6.1.7.10) + actiontext (= 6.1.7.10) + actionview (= 6.1.7.10) + activejob (= 6.1.7.10) + activemodel (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) bundler (>= 1.15.0) - railties (= 6.1.7.9) + railties (= 6.1.7.10) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -256,9 +256,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (6.1.7.9) - actionpack (= 6.1.7.9) - activesupport (= 6.1.7.9) + railties (6.1.7.10) + actionpack (= 6.1.7.10) + activesupport (= 6.1.7.10) method_source rake (>= 12.2) thor (~> 1.0) @@ -269,8 +269,8 @@ GEM ffi (~> 1.0) rb-readline (0.5.5) regexp_parser (2.9.2) - rexml (3.3.8) - rspec-core (3.13.1) + rexml (3.3.9) + rspec-core (3.13.2) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) @@ -289,17 +289,17 @@ GEM rspec-support (3.13.1) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.67.0) + rubocop (1.69.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.4, < 3.0) - rubocop-ast (>= 1.32.2, < 2.0) + rubocop-ast (>= 1.36.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.3) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.36.2) parser (>= 3.3.1.0) ruby-progressbar (1.13.0) rubyzip (2.3.2) @@ -313,7 +313,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt - selenium-webdriver (4.25.0) + selenium-webdriver (4.27.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) @@ -353,8 +353,8 @@ GEM tins (~> 1.0) thor (1.3.2) tilt (2.4.0) - timeout (0.4.1) - tins (1.36.1) + timeout (0.4.2) + tins (1.37.0) bigdecimal sync truncato (0.7.12) @@ -367,7 +367,9 @@ GEM concurrent-ruby (~> 1.0) uglifier (4.2.1) execjs (>= 0.3.0, < 3) - unicode-display_width (2.6.0) + unicode-display_width (3.1.2) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) @@ -379,7 +381,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.7.0) + zeitwerk (2.7.1) PLATFORMS aarch64-linux @@ -398,10 +400,10 @@ PLATFORMS x86_64-linux-musl DEPENDENCIES - actioncable (~> 6.1.7.9) - actionmailer (~> 6.1.7.9) - actionpack (~> 6.1.7.9) - actiontext (~> 6.1.7.9) + actioncable (~> 6.1.7.10) + actionmailer (~> 6.1.7.10) + actionpack (~> 6.1.7.10) + actiontext (~> 6.1.7.10) base64 (~> 0.2.0) bcrypt_pbkdf bigdecimal @@ -433,7 +435,7 @@ DEPENDENCIES net-smtp pagy (~> 9.0) puma (>= 6.4.3) - rails (~> 6.1.7.9) + rails (~> 6.1.7.10) rails-controller-testing rb-readline rexml (>= 3.3.6) @@ -456,4 +458,4 @@ RUBY VERSION ruby 3.3.3p89 BUNDLED WITH - 2.5.16 + 2.5.23 From 87aa1c88fdf69d1bb06ca0263c51c85c7af7a673 Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Mon, 25 Nov 2024 09:51:14 -0500 Subject: [PATCH 16/18] Update to Rails 6.1.7.10 From b7d79bc80993c70ce7fdfbb92470aed08c6d1cdd Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Wed, 27 Nov 2024 12:00:47 -0500 Subject: [PATCH 17/18] Add brakeman.ignore file to ignore brakeman warning for Rails 6.1.7.10 --- config/brakeman.ignore | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 config/brakeman.ignore diff --git a/config/brakeman.ignore b/config/brakeman.ignore new file mode 100644 index 00000000..e5c9fb41 --- /dev/null +++ b/config/brakeman.ignore @@ -0,0 +1,25 @@ +{ + "ignored_warnings": [ + { + "warning_type": "Unmaintained Dependency", + "warning_code": 120, + "fingerprint": "d84924377155b41e094acae7404ec2e521629d86f97b0ff628e3d1b263f8101c", + "check_name": "EOLRails", + "message": "Support for Rails 6.1.7.10 ended on 2024-10-01", + "file": "Gemfile.lock", + "line": 233, + "link": "https://brakemanscanner.org/docs/warning_types/unmaintained_dependency/", + "code": null, + "render_path": null, + "location": null, + "user_input": null, + "confidence": "High", + "cwe_id": [ + 1104 + ], + "note": "" + } + ], + "updated": "2024-11-27 12:00:12 -0500", + "brakeman_version": "6.2.2" +} From 981cd0266b34f8c2a74d75268d066e6811fd6b47 Mon Sep 17 00:00:00 2001 From: Janell Huyck Date: Thu, 23 Jan 2025 08:30:02 -0500 Subject: [PATCH 18/18] Add .bundler-audit file to ignore warnings that need Rails 7 --- .bundler-audit.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .bundler-audit.yml diff --git a/.bundler-audit.yml b/.bundler-audit.yml new file mode 100644 index 00000000..15b40100 --- /dev/null +++ b/.bundler-audit.yml @@ -0,0 +1,15 @@ +ignore: + # rails-html-sanitizer - needs Rails 7 upgrade to fix + - CVE-2024-53989 + - CVE-2024-53988 + - CVE-2024-53987 + - CVE-2024-53986 + - CVE-2024-53985 + + # actionpack - needs Rails 7 upgrade to fix + - CVE-2024-54133 + + + + +