Pipeline renamed but old history is coming agian

5 views
Skip to first unread message

ashok reddy C k

unread,
Nov 13, 2024, 4:36:01 AMNov 13
to go...@googlegroups.com, ch...@thoughtworks.com
Hi Chad/Team,

As we discussed, I found that once I delete the pipeline and again create the pipeline with same name, then this new pipeline brings back the history of old pipeline that had the same name. 

 

Upon further investigation, I learnt that in GoCD, even if I delete the pipeline it left some residual in the GoCD database that's why when someone creates the pipeline with same name again it brings back the history.

 

Can you please explore on this and share your thoughts with us on this issue whether this is a bug in gocd or this can be handled.

Chad Wilson

unread,
Nov 13, 2024, 4:57:16 AMNov 13
to ashok reddy C k, go...@googlegroups.com
Well, it is intentional - in the sense that sometimes pipelines can be deleted accidentally, or pipelines loaded dynamically from config repos (YAML, JSON etc) and having their entire history disappear would really not be desirable. And the name of the pipeline is essentially the primary key/canonical ID in GoCD (which is why you cannot rename pipelines).

However there is also no built-in database archival or maintenance policy/schedule, e.g to delete history for pipelines that are "unused" for a period of time. There is an old issue at https://github.com/gocd/gocd/issues/879 (which perhaps I should re-open for clarity), but it's not something that exists right now.

Some folks have example queries in that thread (un-tested/validated) for their own mechanism to cleanup the database you could explore if you want to do a one-time cleanup - but at your own risk (backup DB/config/artifacts first!). The schema is not super-complicated though.

-Chad
Reply all
Reply to author
Forward
0 new messages