CDRH / orchid

Rails Engine for site integration with CDRH API
MIT License
3 stars 0 forks source link

Add diff command examples to see lists of files updated between tags/branches to changelog #258

Open techgique opened 1 year ago

techgique commented 1 year ago

Seeing a list of controllers, helpers, and views updated in Orchid would be more helpful than our brief text descriptions of changes in our changelog when actually updating Orchid-based Rails apps. These lists of files are easily obtained with a git diff command specifying the tags or branches to diff followed by the directory to compare:

$ git diff --name-only v3.1.0 v3.1.1 app/views/

app/views/items/_browse_facet_header.html.erb
app/views/items/_browse_header.html.erb
app/views/items/_date_limit.html.erb
app/views/items/_facets.html.erb
app/views/items/_index_header.html.erb
app/views/items/_search_preset_header.html.erb
app/views/items/browse.html.erb
app/views/items/browse_facet.html.erb
app/views/items/index.html.erb
app/views/items/search_preset.html.erb
app/views/layouts/body/_languages.html.erb
app/views/layouts/body/_title.html.erb
app/views/layouts/head/_analytics.html.erb
app/views/layouts/head/_head.html.erb
app/views/layouts/head/_language.html.erb
app/views/layouts/head/_meta.html.erb

I looked into GitHub compare, but it doesn't allow one to narrow to specific directories like this.

From this, one can compare to the list of overrides in an Orchid-based Rails app. Then one can drop the --name-only option and specify only the files relevant to see the full diff of changes that probably need to be incorporated. I think this will make it easier to review Orchid-based Rails apps when we update the version of Orchid they are using.

To not bloat the changelog, maybe we should just include example commands at the top of the changelog for reference rather than include the exact commands and/or output in our Migration section of our changelogs per release.

Example situation where these diff lists would be helpful: https://github.com/CDRH/african_poetics/issues/52#issuecomment-1268913888

Perhaps we should trial this approach and see what we think will be most helpful in saving time for this process:

wkdewey commented 1 year ago

@techgique Do you envision a list of git commands or a script that will do this? Can all of this be handled in Git?

wkdewey commented 1 year ago

Like this?

git diff --name-only [current version tag] [previous version tag] app/views/items app/views/layouts/body app/views/controllers  app/helpers
Git diff [current version tag] [previous version tag] app/views/items 
Git diff [current version tag] [previous version tag] app/views/layouts/body
Git diff [current version tag] [previous version tag] app/views/controllers
Git diff [current version tag] [previous version tag] app/helpers

I think this gets all the files that are typically overriden. (other than config files) The only change would be in the names of the versions.

wkdewey commented 1 year ago

I added the above to the latest version of the changelog