Skip to content

fix(3485): v1 -> v2 event redirects navigate to the wrong event in the UI#1571

Open
sagar1312 wants to merge 1 commit intomasterfrom
sagar1312-fix-3485-v1-to-v2-event-redirection
Open

fix(3485): v1 -> v2 event redirects navigate to the wrong event in the UI#1571
sagar1312 wants to merge 1 commit intomasterfrom
sagar1312-fix-3485-v1-to-v2-event-redirection

Conversation

@sagar1312
Copy link
Copy Markdown
Member

Context

When a user visits a v1 pipeline event URL (e.g. /pipelines/123456/events/98765), the pipeline.events parent route's beforeModel() hook redirects to the v2 UI by calling this.replaceWith('v2.pipeline.events', pipeline.id). This targets the v2 events index route, which always resolves to the pipeline's latest event (pipeline.lastEventId) — discarding the original event_id from the URL.

As a result, users land on the wrong event in v2 instead of the one they originally navigated to.

Objective

Preserve the event_id when redirecting from a v1 event URL to v2.

The fix reads the event_id via this.paramsFor('pipeline.events.show') in the parent route's beforeModel() hook (Ember parses all route segments from the URL upfront, so child params are available at this point) and redirects directly to v2.pipeline.events.show with the same event ID.
If no event ID is present (e.g. visiting /pipelines/:id/events without a specific event), the existing fallback to the latest event is preserved.

An acceptance test is added to verify that visiting a v1 event URL redirects to the equivalent v2 URL with the same event ID.

References

screwdriver-cd/screwdriver#3483

License

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

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