Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset to defaults, test PR #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions .github/workflows/diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- main
paths:
- 'backend/model/**'
push:
paths:
- 'backend/model/**'

jobs:
diff:
Expand Down Expand Up @@ -43,27 +46,43 @@ jobs:
sparse-checkout: |
backend/app/model

- name: Create plugin file
run: |
touch plugin.txt
grep -wsh after_create ${{ github.workspace }}/plugin/backend/model/* -A 81 > plugin.txt

- name: Create prod version file
id: prod
run: |
touch prod.txt
grep -wsh after_create ${{ github.workspace }}/archivesspace-baseline/backend/app/model/repository.rb -A 81 > prod.txt

- name: Create ${{ matrix.archivesspace_version }} version file
run: |
touch ${{ matrix.archivesspace_version }}.txt
grep -wsh after_create ${{ github.workspace }}/archivesspace/backend/app/model/repository.rb -A 81 > ${{ matrix.archivesspace_version }}.txt

- name: Diff with baseline
id: baseline
run: |
echo "baseline_changes=$(git diff --diff-filter=M --shortstat ${{ github.workspace }}/archivesspace-baseline/backend/app/model ${{ github.workspace }}/plugin/backend/model)" > $GITHUB_OUTPUT

echo "baseline_changes=$(git diff --diff-filter=M --shortstat ${{ github.workspace }}/prod.txt ${{ github.workspace }}/plugin.txt)" >> $GITHUB_OUTPUT
- name: Diff with new versions
id: new
run: |
echo "new_changes=$(git diff --diff-filter=M --shortstat ${{ github.workspace }}/archivesspace/backend/app/model ${{ github.workspace }}/plugin/backend/model)" > $GITHUB_OUTPUT
echo "new_changes=$(git diff --diff-filter=M --shortstat ${{ github.workspace }}/${{ matrix.archivesspace_version }}.txt ${{ github.workspace }}/plugin.txt)" >> $GITHUB_OUTPUT

- name: Diffs match
if: ${{ steps.baseline.outputs.baseline_changes == steps.new.outputs.new_changes }}
run: |
echo "${{ steps.baseline.outputs.baseline_changes }}"
echo "${{ steps.new.outputs.new_changes }}"
echo "${{ steps.new.outputs.new_changes2 }}"
echo "All models overridden by this plugin match $PROD_ARCHIVESSPACE_VERSION of ArchivesSpace"
echo "$(git diff --diff-filter=M -w --color -- ${{ github.workspace }}/${{ matrix.archivesspace_version }}.txt ${{ github.workspace }}/plugin.txt)"
echo "All models overridden by this plugin match ${{ matrix.archivesspace_version }} of ArchivesSpace"

- name: Diffs do not match
if: ${{ steps.baseline.outputs.baseline_changes != steps.new.outputs.new_changes }}
run: |
echo "Some models overridden by this plugin do not match those in ArchivesSpace ${{ matrix.archivesspace_version }}. See:"
echo "::set-output name=review_changes::$(git diff --diff-filter=M -w --color -- ${{ github.workspace }}/archivesspace/backend/app/model ${{ github.workspace }}/plugin/backend/model)"
echo "::set-output name=review_changes::$(git diff --diff-filter=M -w --color -- ${{ github.workspace }}/${{ matrix.archivesspace_version }}.txt ${{ github.workspace }}/plugin.txt)"
exit 1
2 changes: 1 addition & 1 deletion backend/model/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def after_create
{
:group_code => "repository-viewers",
:description => I18n.t("group.default_group_names.repository_viewers", :repo_code => repo_code),
:grants_permissions => ["view_repository", "create_job"]
:grants_permissions => ["view_repository", "new_madeup_permission"]
}]

RequestContext.open(:repo_id => self.id) do
Expand Down
Loading