Reorder traject config discovery to follow collection records pattern#14
Reorder traject config discovery to follow collection records pattern#14alexdryden merged 7 commits intoindex_creatorsfrom
Conversation
- Add fallback search in arcflow package directory for development - Add clear logging showing which traject config is being used - Add warning when using arcflow package version (development mode) - Improve error messages when traject config not found - Document that traject config belongs in arcuit gem, not arcflow - Update README with traject config location guidance Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
- Change log level from error to warning for missing traject config - Update example path to clarify arcuit gem location - Show actual searched paths in error message for better troubleshooting Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
|
@copilot I was more looking for a rationale for a specific approach. How about this: let's follow the pattern of the collection records. So, the first place we should look is in arcuit using the provided parameter for the location of arcuit. This is the most up to date control that was provided by the end user immediately before running the script, so use this first. But, to keep this backward compatible and able to run just collection records, arcuit parameter is optional. So, if it isn't provided, only then do we try If it is not there (perhaps this is being used as a module without arcuit) then we fallback to a file local to arcflow called example_traject_config_eac_cpf.rb. And in all cases we log what has happened. This means that we are maintaining two copies of the traject config but I think we can live with that. |
- Change search order: arcuit_dir (1st) → bundle show (2nd) → example file (3rd) - Rename traject_config_eac_cpf.rb to example_traject_config_eac_cpf.rb - Prioritize arcuit_dir parameter as most up-to-date user control - Fall back to example file for module usage without arcuit - Update README with new search order and example file guidance Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
Implemented in commit 2ac19db. The traject config search now follows the collection records pattern: Search Order:
Changes:
The two copies approach (example in arcflow + production in arcuit) is now documented in the README. |
- Update usage comment to reference correct filename - Improve log message formatting for consistency - Add note about copying to arcuit for production use Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
|
Also, lets not look for the traject config in a arcflow directory inside arcuit, that was just a development artifact. So, don't look in arcuit_dir/arcflow as a search path. Lets just look in the root of arcuit_dir and then in arcuit_dir/lib/arcuit/traject, which follows the pattern for where the ead traject is stored in arclight. |
|
@copilot Also, lets not look for the traject config in a arcflow directory inside arcuit, that was just a development artifact. So, don't look in arcuit_dir/arcflow as a search path. Lets just look in the root of arcuit_dir and then in arcuit_dir/lib/arcuit/traject, which follows the pattern for where the ead traject is stored in arclight. |
- Remove arcuit_dir/arcflow path (development artifact) - Add arcuit_dir/lib/arcuit/traject path (matches EAD traject location) - Apply same paths to both arcuit_dir and bundle show arcuit searches - Update debug message to reflect new subdirectory checked Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
Updated search paths in commit addee2b: Removed:
Now searching:
Applied to both arcuit_dir parameter and bundle show arcuit searches. |
| self.log.warning('Could not find traject config (bundle show arcuit failed and arcuit_dir not provided or invalid)') | ||
| self.log.debug(f' Error checking for arcuit gem: {e}') | ||
|
|
||
| # Try 3: example file in arcflow package (fallback for module usage without arcuit) |
There was a problem hiding this comment.
@copilot we know exactly where we intend to put the file within arcflow--we don't need to search for it. Lets just look where we know it to be.
There was a problem hiding this comment.
Simplified in commit 43fc88c. Now directly checks the one known location at repo root instead of looping through candidate paths.
- Remove candidate paths loop for example file - Directly check the one known location at repo root - Add comment explaining we know the exact location Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.