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

Omeka import #65

Merged
merged 15 commits into from
Mar 11, 2024
Merged

Omeka import #65

merged 15 commits into from
Mar 11, 2024

Conversation

maehr
Copy link
Member

@maehr maehr commented Mar 6, 2024

Pull request

Proposed changes

Types of changes

  • New feature (non-breaking change which adds functionality).
  • Enhancement (non-breaking change which enhances functionality)
  • Bug Fix (non-breaking change which fixes an issue).
  • Breaking change (fix or feature that would cause existing functionality to change).

Checklist

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Summary by CodeRabbit

  • New Features

    • Introduced a new workflow "Deploy Jekyll site with Data Processing" to enhance site deployment with advanced data processing capabilities.
    • Added support for Omeka API integration, enabling automated data retrieval and processing from collections for site content updates.
  • Improvements

    • Expanded workflow triggers to include additional branches for more flexible development workflows.
    • Optimized Ruby setup configuration for improved build performance.
  • Chores

    • Cleaned up workflow configuration by removing outdated comments and unused settings.

@maehr maehr self-assigned this Mar 6, 2024
Copy link

changeset-bot bot commented Mar 6, 2024

⚠️ No Changeset found

Latest commit: 6e9ac82

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

coderabbitai bot commented Mar 6, 2024

Walkthrough

This update introduces significant enhancements to the GitHub workflow for a Jekyll site, focusing on Omeka S integration and improved deployment processes. It adds a new data processing job for handling data with Python, specifically for interacting with the Omeka API, and updates the build and deployment jobs to ensure a smooth workflow. The changes aim to streamline the deployment of the Jekyll site while enabling efficient data processing and integration with Omeka S collections.

Changes

File Path Change Summary
.github/workflows/jekyll.yml - Workflow name updated
- Branch triggers expanded to include main
- Added environment variables for Omeka API
- Introduced data-processing job
- Updated build job dependencies
- Updated Ruby setup
- Updated deployment job dependencies
_includes/item/image-gallery.html - Modified href attribute in anchor tag to use page.image_small

Assessment against linked issues

Objective Addressed Explanation
Omeka S integration (#8), GitHub Action for GHpages deployment (#6)

🐰✨📜✨🐰

In the land of code and sun,

Changes big, the work's begun.

With Omeka's treasures in our grasp,

We weave a web, a mighty clasp.

Deploy we shall, with ease and cheer,

For every byte, we hold dear. 🌟🐾

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a4eab88 and 933f191.
Files ignored due to path filters (41)
  • _data/config-metadata.csv is excluded by: !**/*.csv
  • _data/demo-compoundobjects-metadata.csv is excluded by: !**/*.csv
  • _data/demo-metadata.csv is excluded by: !**/*.csv
  • _data/sgb-metadata.csv is excluded by: !**/*.csv
  • objects/210a.jpg is excluded by: !**/*.jpg
  • objects/210b.jpg is excluded by: !**/*.jpg
  • objects/abb21535.jpeg.jpg is excluded by: !**/*.jpg
  • objects/abb42444.jpeg.jpg is excluded by: !**/*.jpg
  • objects/demo_001.jpg is excluded by: !**/*.jpg
  • objects/demo_002.pdf is excluded by: !**/*.pdf
  • objects/demo_003.mp3 is excluded by: !**/*.mp3
  • objects/demo_004.jpg is excluded by: !**/*.jpg
  • objects/hells_half_theta.jpg is excluded by: !**/*.jpg
  • objects/hughes_article.png is excluded by: !**/*.png
  • objects/object_list.csv is excluded by: !**/*.csv
  • objects/small/210a_sm.jpg is excluded by: !**/*.jpg
  • objects/small/210b_sm.jpg is excluded by: !**/*.jpg
  • objects/small/abb13578_sm.jpg is excluded by: !**/*.jpg
  • objects/small/abb19619_sm.jpg is excluded by: !**/*.jpg
  • objects/small/abb21535.jpeg_sm.jpg is excluded by: !**/*.jpg
  • objects/small/abb40689_sm.jpg is excluded by: !**/*.jpg
  • objects/small/abb42444.jpeg_sm.jpg is excluded by: !**/*.jpg
  • objects/small/demo_001_sm.jpg is excluded by: !**/*.jpg
  • objects/small/demo_002_sm.jpg is excluded by: !**/*.jpg
  • objects/small/demo_003_sm.jpg is excluded by: !**/*.jpg
  • objects/small/demo_004_sm.jpg is excluded by: !**/*.jpg
  • objects/small/hells_half_theta_sm.jpg is excluded by: !**/*.jpg
  • objects/small/hughes_article_sm.jpg is excluded by: !**/*.jpg
  • objects/thumbs/210a_th.jpg is excluded by: !**/*.jpg
  • objects/thumbs/210b_th.jpg is excluded by: !**/*.jpg
  • objects/thumbs/abb13578_th.jpg is excluded by: !**/*.jpg
  • objects/thumbs/abb19619_th.jpg is excluded by: !**/*.jpg
  • objects/thumbs/abb21535.jpeg_th.jpg is excluded by: !**/*.jpg
  • objects/thumbs/abb40689_th.jpg is excluded by: !**/*.jpg
  • objects/thumbs/abb42444.jpeg_th.jpg is excluded by: !**/*.jpg
  • objects/thumbs/demo_001_th.jpg is excluded by: !**/*.jpg
  • objects/thumbs/demo_002_th.jpg is excluded by: !**/*.jpg
  • objects/thumbs/demo_003_th.jpg is excluded by: !**/*.jpg
  • objects/thumbs/demo_004_th.jpg is excluded by: !**/*.jpg
  • objects/thumbs/hells_half_theta_th.jpg is excluded by: !**/*.jpg
  • objects/thumbs/hughes_article_th.jpg is excluded by: !**/*.jpg
Files selected for processing (1)
  • .github/workflows/jekyll.yml (1 hunks)
Additional comments: 6
.github/workflows/jekyll.yml (6)
  • 1-1: The workflow name has been updated to reflect the new functionality of data processing alongside Jekyll site deployment.
  • 6-7: Branch triggers have been updated to include both main and omeka-import. This ensures that the workflow runs for changes made to either branch, facilitating continuous integration and testing for the Omeka S integration efforts.
  • 19-23: Environment variables for the Omeka API have been added. These are crucial for authenticating and interacting with the Omeka S API. It's important to ensure that these secrets (OMEKA_API_URL, KEY_IDENTITY, KEY_CREDENTIAL, ITEM_SET_ID) are properly set in the repository's secrets before merging this PR.
  • 26-110: The data-processing job has been added to handle data processing tasks using Python. This job fetches items from Omeka collections and performs necessary mapping of columns. It's important to ensure that the Python script is correctly fetching and processing data from the Omeka API. The use of environment variables for API credentials and item set ID is a good practice. However, there are a few points to consider:
  1. Error handling: The script should handle potential errors more gracefully. For example, if the response status code is not 200, it simply breaks the loop without logging any error or raising an exception. It would be beneficial to log an error message or raise an exception to make debugging easier in case of API failures.
  2. Data mapping: The mapping function map_columns assumes the presence of certain keys in the data. It's important to verify that these keys always exist in the data returned by the Omeka API or handle cases where they might be missing.
  3. Image URLs: The script attempts to set image_small and image_thumb based on the large thumbnail URL. This might not be the intended behavior, as typically, different sizes of images are used for different purposes. Consider verifying this logic.
- if response.status_code != 200:
+ if response.status_code != 200:
+     raise Exception(f"Failed to fetch items from collection: HTTP {response.status_code}")
  • 113-122: The build job has been updated to depend on the successful completion of the data-processing job. This ensures that the site build process only proceeds if the data processing tasks have been successfully executed. The Ruby setup configuration has also been updated. These changes help maintain the integrity and reliability of the deployment process.
  • 135-135: The deployment job has been updated to depend on the build job, refining the workflow's execution sequence and ensuring a coherent and efficient deployment process. This change aligns with best practices for CI/CD workflows.

@maehr maehr requested a review from koilebeit March 6, 2024 13:51
@maehr
Copy link
Member Author

maehr commented Mar 6, 2024

@koilebeit Can you please take a look at the actions with https://github.com/nektos/act. My docker is on the frizz at the moment.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 933f191 and ee73cc4.
Files selected for processing (1)
  • .github/workflows/jekyll.yml (1 hunks)
Additional comments: 5
.github/workflows/jekyll.yml (5)
  • 1-1: The workflow name change to "Deploy Jekyll site with Data Processing" clearly reflects the new functionality being added. This is a good practice for clarity and maintainability.
  • 6-7: Adding main and omeka-import as branch triggers ensures that the workflow runs on relevant branches. This is a necessary update for integrating the new data processing functionality.
  • 19-23: The addition of environment variables for Omeka API configuration is crucial for secure and flexible API interaction. Storing sensitive information in GitHub secrets is a best practice for security.
  • 118-132: The build job's dependency on the data-processing job is correctly set up to ensure data is processed before the site build begins. The Ruby setup and caching are appropriately configured, which should help with build performance.
  • 145-145: The deployment job configuration looks correct, with a dependency on the build job to ensure deployment happens after the site is built. This ensures a smooth deployment process.

.github/workflows/jekyll.yml Outdated Show resolved Hide resolved
Copy link

@koilebeit koilebeit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I try it with act I get following Error-Message:
[Deploy Jekyll site with Data Processing/data-processing] ⭐ Run Main Process Data [Deploy Jekyll site with Data Processing/data-processing] 🐳 docker exec cmd=[python /var/run/act/workflow/3.py] user= workdir= | Traceback (most recent call last): | File "/var/run/act/workflow/3.py", line 72, in <module> | item_set = get_items_from_collection(ITEM_SET_ID) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/var/run/act/workflow/3.py", line 18, in get_items_from_collection | response = requests.get(url, params=params) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/requests/api.py", line 73, in get | return request("get", url, params=params, **kwargs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/requests/api.py", line 59, in request | return session.request(method=method, url=url, **kwargs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/requests/sessions.py", line 575, in request | prep = self.prepare_request(req) | ^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/requests/sessions.py", line 486, in prepare_request | p.prepare( | File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/requests/models.py", line 368, in prepare | self.prepare_url(url, params) | File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/requests/models.py", line 439, in prepare_url | raise MissingSchema( | requests.exceptions.MissingSchema: Invalid URL 'items': No scheme supplied. Perhaps you meant https://items? [Deploy Jekyll site with Data Processing/data-processing] ❌ Failure - Main Process Data [Deploy Jekyll site with Data Processing/data-processing] exitcode '1': failure [Deploy Jekyll site with Data Processing/data-processing] 🏁 Job failed Error: Job 'data-processing' failed

edit: probably I do not have set the OS environment variables..

@koilebeit
Copy link

Apart from the github action, the objectid must be lowercase (see https://collectionbuilder.github.io/cb-docs/docs/metadata/csv_metadata/#objectid).
The object_location field is also missing, otherwise the images and data cannot be downloaded (https://collectionbuilder.github.io/cb-docs/docs/metadata/csv_metadata/#object_location)

@maehr
Copy link
Member Author

maehr commented Mar 6, 2024

Apart from the github action, the objectid must be lowercase (see https://collectionbuilder.github.io/cb-docs/docs/metadata/csv_metadata/#objectid). The object_location field is also missing, otherwise the images and data cannot be downloaded (https://collectionbuilder.github.io/cb-docs/docs/metadata/csv_metadata/#object_location)

I get it to work with uppercase objectid (perhaps the sanitization of cb does the trick). Leaving out object_location is by design (or choice). As long as we cannot access these files directly from Omeka we cannot integrate the links.

PS: If it doesn't work, we should think about renaming the objects in Omeka.

@maehr
Copy link
Member Author

maehr commented Mar 6, 2024

When I try it with act I get following Error-Message: [Deploy Jekyll site with Data Processing/data-processing] ⭐ Run Main Process Data [Deploy Jekyll site with Data Processing/data-processing] 🐳 docker exec cmd=[python /var/run/act/workflow/3.py] user= workdir= | Traceback (most recent call last): | File "/var/run/act/workflow/3.py", line 72, in <module> | item_set = get_items_from_collection(ITEM_SET_ID) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/var/run/act/workflow/3.py", line 18, in get_items_from_collection | response = requests.get(url, params=params) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/requests/api.py", line 73, in get | return request("get", url, params=params, **kwargs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/requests/api.py", line 59, in request | return session.request(method=method, url=url, **kwargs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/requests/sessions.py", line 575, in request | prep = self.prepare_request(req) | ^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/requests/sessions.py", line 486, in prepare_request | p.prepare( | File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/requests/models.py", line 368, in prepare | self.prepare_url(url, params) | File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/requests/models.py", line 439, in prepare_url | raise MissingSchema( | requests.exceptions.MissingSchema: Invalid URL 'items': No scheme supplied. Perhaps you meant https://items? [Deploy Jekyll site with Data Processing/data-processing] ❌ Failure - Main Process Data [Deploy Jekyll site with Data Processing/data-processing] exitcode '1': failure [Deploy Jekyll site with Data Processing/data-processing] 🏁 Job failed Error: Job 'data-processing' failed

edit: probably I do not have set the OS environment variables..

I added the secrets also to my fork and it seems to work https://github.com/maehr/collectionbuilder-csv/actions/runs/8173244290

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between ee73cc4 and 5459d18.
Files selected for processing (1)
  • .github/workflows/jekyll.yml (1 hunks)
Additional comments: 4
.github/workflows/jekyll.yml (4)
  • 1-1: The workflow name has been updated to "Deploy Jekyll site with Data Processing" to reflect the new functionality of processing data alongside deploying the Jekyll site. This change accurately describes the enhanced capabilities of the workflow.
  • 6-7: Branch triggers have been updated to include both main and omeka-import. This ensures that the workflow runs on pushes to these branches, facilitating continuous integration and deployment for both the primary branch and the feature branch related to Omeka S integration.
  • 19-23: Environment variables for Omeka API configuration have been added. This is a good practice as it keeps sensitive information out of the codebase and allows for easy updates without modifying the workflow file. Ensure that these secrets (OMEKA_API_URL, KEY_IDENTITY, KEY_CREDENTIAL, ITEM_SET_ID) are properly set in the repository's settings.
  • 118-145: The build and deploy jobs have been updated to depend on the data-processing and build jobs, respectively. This ensures that the workflow executes in the correct order, with data processing completed before the site build, and the site build completed before deployment. The use of artifact upload and download steps to pass data between jobs is a good practice for maintaining modularity and separation of concerns within the workflow.

.github/workflows/jekyll.yml Outdated Show resolved Hide resolved
@maehr
Copy link
Member Author

maehr commented Mar 8, 2024

@koilebeit the script turns all multiple/compound_items into compound_items https://github.com/maehr/collectionbuilder-csv/actions/runs/8207996344
haven't had the time to fix that.

@maehr maehr requested a review from koilebeit March 8, 2024 19:22
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 5459d18 and 7d2982f.
Files selected for processing (2)
  • .github/workflows/jekyll.yml (1 hunks)
  • .github/workflows/process_data.py (1 hunks)
Additional comments: 12
.github/workflows/jekyll.yml (7)
  • 1-1: The workflow name change to "Deploy Jekyll site with Data Processing" clearly reflects the new functionality being added, which is a good practice for clarity and maintainability.
  • 6-7: Adding the omeka-import branch to the workflow triggers ensures that the data processing and deployment steps are executed for changes made specifically for Omeka S integration, which is a thoughtful addition.
  • 19-23: The addition of environment variables for Omeka API configuration is a secure way to handle sensitive information. However, ensure that these secrets (OMEKA_API_URL, KEY_IDENTITY, KEY_CREDENTIAL, ITEM_SET_ID) are properly set in the repository's secrets before merging this PR.
  • 43-43: The dependency of the build job on the data-processing job ensures that the site is not built until the data processing is complete, which is a crucial step for ensuring data consistency.
  • 48-52: Downloading the artifact produced by the data-processing job in the build job is a good practice to ensure that the latest processed data is used for building the site.
  • 56-57: The Ruby setup configuration with bundler-cache: true and specifying a cache-version is a good practice for speeding up the build process by caching dependencies.
  • 70-70: Ensuring the deploy job runs on the latest Ubuntu version and depends on the build job is a good practice for maintaining a streamlined and dependent workflow execution.
.github/workflows/process_data.py (5)
  • 1-4: The imports are correctly organized and only necessary libraries are imported, which is good for maintainability and avoiding unnecessary dependencies.
  • 6-9: Extracting Omeka API configuration from environment variables is a secure practice. Ensure that these variables are correctly set in the GitHub Actions workflow to avoid runtime errors.
  • 54-70: The map_columns function processes the item set to map columns for the CSV file. This function handles compound objects well by creating separate entries for each media item. However, ensure that the logic for handling items with multiple media is consistent with the project's data requirements.
  • 73-104: The create_media_data_dict function constructs a dictionary for each item/media pair. It's well-implemented, but consider adding validation for the existence of keys in the data dictionary to avoid potential KeyError exceptions.

Consider adding validation for the existence of keys in the data dictionary in the create_media_data_dict function to avoid potential KeyError exceptions.

  • 106-109: The script execution block correctly retrieves items from the collection, maps columns, and writes the data to a CSV file. This is a crucial step for integrating Omeka S data into the Jekyll site. Ensure that the CSV file path matches the expected location in the Jekyll site structure.

.github/workflows/process_data.py Show resolved Hide resolved
.github/workflows/process_data.py Show resolved Hide resolved
@maehr
Copy link
Member Author

maehr commented Mar 8, 2024

@koilebeit I added multiples as well. Now the only caveat is that PDF files are not shown nor downloadable. See the build files https://github.com/maehr/collectionbuilder-csv/actions/runs/8208244993

@koilebeit
Copy link

@koilebeit I added multiples as well. Now the only caveat is that PDF files are not shown nor downloadable. See the build files https://github.com/maehr/collectionbuilder-csv/actions/runs/8208244993

The PDF files cannot be downloaded because the column object_location is empty. And they are not shown because image_small and image_thumb are empty (see CB display_template)

Then I noticed that the display_template is still filled out incorrectly. As I understand it from the documentation CB Compound Objects the parent object gets the display_template "compound_object", the sub-objects each get their format (e.g. "pdf" or "image") like this:

objectid parentid display_template
abb001 compound_object
abb001_a abb001 pdf
abb001_b abb001 pdf

@maehr
Copy link
Member Author

maehr commented Mar 9, 2024

@koilebeit I added multiples as well. Now the only caveat is that PDF files are not shown nor downloadable. See the build files https://github.com/maehr/collectionbuilder-csv/actions/runs/8208244993

The PDF files cannot be downloaded because the column object_location is empty. And they are not shown because image_small and image_thumb are empty (see CB display_template)

Then I noticed that the display_template is still filled out incorrectly. As I understand it from the documentation CB Compound Objects the parent object gets the display_template "compound_object", the sub-objects each get their format (e.g. "pdf" or "image") like this:

objectid parentid display_template
abb001 compound_object
abb001_a abb001 pdf
abb001_b abb001 pdf

I'll check again and fix it. I guess we can add the object_location by checking for the media to be private or not first.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 7d2982f and 9620200.
Files selected for processing (1)
  • .github/workflows/process_data.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/process_data.py

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9620200 and b8647bc.
Files selected for processing (1)
  • .github/workflows/process_data.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/process_data.py

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b8647bc and 6e9ac82.
Files ignored due to path filters (1)
  • _data/theme.yml is excluded by: !**/*.yml
Files selected for processing (2)
  • .github/workflows/jekyll.yml (1 hunks)
  • _includes/item/image-gallery.html (1 hunks)
Additional comments: 6
.github/workflows/jekyll.yml (6)
  • 1-1: The workflow name "Deploy Jekyll site with Data Processing" clearly reflects its purpose and the addition of data processing steps.
  • 6-6: Adding main to the branch triggers is a good practice, ensuring the workflow runs for updates to the main branch.
  • 18-22: The addition of environment variables for the Omeka API and related credentials is crucial for secure data processing. Ensure that the process_data.py script properly uses these secrets without exposing them in logs or outputs.
Verification successful

Given the output, there's no direct evidence of secrets being exposed through print statements, as the output only shows error messages with response status codes. However, to fully ensure that secrets are used securely throughout the process_data.py script, further verification is necessary. We need to examine how secrets are accessed and used within the script, beyond just the presence of print or logger statements.


The analysis of the process_data.py script, based on the provided output, indicates that the secrets (OMEKA_API_URL, KEY_IDENTITY, KEY_CREDENTIAL, ITEM_SET_ID) are accessed securely using os.environ.get and are used appropriately for constructing URLs, parameters, and function calls related to API requests. There's no evidence of these secrets being exposed in logs or outputs. Therefore, the script appears to handle the secrets securely as per the review comment's concern.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that secrets are used securely in the process_data.py script
rg --type py 'print|logger' .github/workflows/process_data.py

Length of output: 163



Script:

#!/bin/bash
# Verify how secrets are accessed and used in the process_data.py script
rg --type py 'OMEKA_API_URL|KEY_IDENTITY|KEY_CREDENTIAL|ITEM_SET_ID' .github/workflows/process_data.py

Length of output: 587

* 42-42: Ensuring the `build` job depends on the successful completion of `data-processing` is a logical and efficient workflow design. * 55-56: The Ruby setup configuration uses a specific commit hash for the `setup-ruby` action. While this ensures stability, consider using a version tag for readability, unless stability concerns necessitate the use of a specific commit. * 69-69: The deployment job's dependency on the `build` job ensures that the site is built before deployment, which is a good practice for maintaining a reliable deployment process.

_includes/item/image-gallery.html Show resolved Hide resolved
.github/workflows/jekyll.yml Show resolved Hide resolved
@maehr maehr requested review from koilebeit and mtwente and removed request for koilebeit March 11, 2024 08:24
@maehr maehr merged commit ce8de23 into Stadt-Geschichte-Basel:main Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Omeka S integration GitHub Action for GHpages deployment
3 participants