Skip to content

Reorder traject config discovery to follow collection records pattern#14

Merged
alexdryden merged 7 commits intoindex_creatorsfrom
copilot/sub-pr-8-yet-again
Feb 19, 2026
Merged

Reorder traject config discovery to follow collection records pattern#14
alexdryden merged 7 commits intoindex_creatorsfrom
copilot/sub-pr-8-yet-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

  • Review current traject config discovery mechanism
  • Analyze where traject_config_eac_cpf.rb should belong (arcflow vs arcuit)
  • Improve logging to show which traject config is being used
  • Update discovery logic with arcflow package fallback
  • Document the decision and rationale
  • Test the changes
  • Address code review feedback
  • Reorder search to follow collection records pattern (arcuit_dir first)
  • Update search paths to follow ArcLight pattern (lib/arcuit/traject)
  • Simplify example file search to single known location

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 13, 2026 19:02
- 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 AI changed the title [WIP] Add creator record generation and automatic indexing Improve traject config discovery with clear logging and arcflow package fallback Feb 13, 2026
Copilot AI requested a review from alexdryden February 13, 2026 19:06
@alexdryden
Copy link
Contributor

@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 bundle show arcuit.

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>
Copy link
Contributor Author

Copilot AI commented Feb 19, 2026

@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 provi...

Implemented in commit 2ac19db. The traject config search now follows the collection records pattern:

Search Order:

  1. arcuit_dir parameter (if provided) - highest priority
  2. bundle show arcuit - backward compatibility when arcuit_dir not provided
  3. example_traject_config_eac_cpf.rb in arcflow - fallback for module usage

Changes:

  • Renamed traject_config_eac_cpf.rbexample_traject_config_eac_cpf.rb
  • Moved arcuit_dir check to first priority
  • Updated logging to indicate when example file is used
  • Maintained clear logging at each step

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>
Copilot AI changed the title Improve traject config discovery with clear logging and arcflow package fallback Reorder traject config discovery to follow collection records pattern Feb 19, 2026
@alexdryden
Copy link
Contributor

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.

@alexdryden alexdryden marked this pull request as ready for review February 19, 2026 16:05
@alexdryden
Copy link
Contributor

@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>
Copy link
Contributor Author

Copilot AI commented Feb 19, 2026

@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...

Updated search paths in commit addee2b:

Removed:

  • arcuit_dir/arcflow (development artifact)

Now searching:

  • arcuit_dir/ (root)
  • arcuit_dir/lib/arcuit/traject/ (follows EAD traject pattern in ArcLight)

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

@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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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>
Copy link
Contributor

@alexdryden alexdryden left a comment

Choose a reason for hiding this comment

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

see comments

@alexdryden alexdryden merged commit e326983 into index_creators Feb 19, 2026
1 check failed
@alexdryden alexdryden deleted the copilot/sub-pr-8-yet-again branch February 19, 2026 16:16
Copilot AI restored the copilot/sub-pr-8-yet-again branch February 19, 2026 16:16
Copilot stopped work on behalf of alexdryden due to an error February 19, 2026 16:16
@alexdryden alexdryden deleted the copilot/sub-pr-8-yet-again branch February 19, 2026 20:50
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.

2 participants