PR Environment name format change causing automations to break
constantm
PROOP

2 years ago

Hello,

It looks like you've changed the PR Environment naming convention, which has unfortunately broken some of our internal tools that depend on the name being a certain format, eg. https://rails-name-pr-1234.railway.app/.

The domain name now contains what looks like a commit hash (but it's not?), and the PR name. Could you share what this middle part is, and how we could configure or access/infer it from outside of Railway?

Thank you!

Solved

8 Replies

2 years ago

Uhh, what are you doing that relies on the naming being a certain format? There's no guarantee the PR can get the name that's generated unfortunately :/

Sometimes it will collide with another PR environment


Status changed to Awaiting User Response Railway over 1 year ago


constantm
PROOP

2 years ago

In our Notion cards, we infer the PR environment link from the PR number. This way, when QA picks up the card, they can just click the link in the card that opens up the PR environment. We've been doing this for a while and haven't had any issues until today.


Status changed to Awaiting Railway Response Railway over 1 year ago


2 years ago

If you close and re-open a PR that we haven't fully cleaned up, this can happen. Were these re-opened PRs?


Status changed to Awaiting User Response Railway over 1 year ago


constantm
PROOP

2 years ago

Yes, this is exactly what happened! I closed and reopened a PR following the issues we had with volume migrations last night. I just created a new PR and it looks like it's working as expected. Thanks for the help!


Status changed to Awaiting Railway Response Railway over 1 year ago


2 years ago

Of course! Behind the scenes, we go can delete the PR environment. That can take up to 1-2 minutes depending on containers, volumes, etc.

While we do this, we don't change the environment name until that environments fully cleaned up, in case something fails to delete.

And, just so you know this only happens if you close and re-open a PR in quick succession.

We're trying to make this faster. BTW looks like the "chemcloud-pr-1432" and "chemcloud-pr-1434" are now unused

So, if you close and re-open that PR (again) you should get the "right names"


Status changed to Awaiting User Response Railway over 1 year ago


constantm
PROOP

2 years ago

Fantastic, thank you for the explanation. Very useful to know!


Status changed to Awaiting Railway Response Railway over 1 year ago


2 years ago

We're talking about this internally to make it so that this doesn't happen. Names are unique, so we add a hash when the delete is completed.

We can add this ahead of time, and if it fails, we can just show the generated hash or something. The DX is a bit odd so we'll have to work on it tho.

For now, if you close stuff, wait a 1-2 minutes before reopening and you should be good


Status changed to Awaiting User Response Railway over 1 year ago


constantm
PROOP

2 years ago

Makes sense! I'll keep this in mind for next time this happens, but I don't foresee this being an issue again, as it was really just because of the other issue that I closed and opened the PR. Thank you again!


Status changed to Awaiting Railway Response Railway over 1 year ago


Status changed to Solved christian over 1 year ago


Loading...