Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: change angular routing order for repo paths (PROJQUAY-2325) #872

Merged
merged 1 commit into from Aug 17, 2021

Conversation

kleesc
Copy link
Member

@kleesc kleesc commented Aug 16, 2021

Unlike Flask, Angular does not use weights to match paths to routes,
so order matters. In order to support repository with "/" in them, we
previously added "*" to the repository name named group, allowing it
to capture subsequent "/". When that's the case, it is important that
to general "catch-all" route comes after the more specific routes (e.g
repo manifest). Otherwise, Angular will just eagerly use the first
route that matches a path, even though it may have "better" match in
subsequent routes.

e.g - '/api/v1/repository/:namespace/:name*'
- '/api/v1/repository/:namespace/:name*/tag/:tag'

  In this case, something like
  /api/v1/repository/devtable/testrepo/tag/testtag would match the
  first route, even though if using a weighted system, the second
  route in most case be a better fit.

@kleesc kleesc force-pushed the ui-route-order-for-repo-named-groups branch 3 times, most recently from 16d8b3c to d633ab7 Compare August 16, 2021 19:34
@kleesc
Copy link
Member Author

kleesc commented Aug 16, 2021

@jonathankingfc @Sunandadadi PTAL when you have some time.

Unlike Flask, Angular does not use weights to match paths to routes,
so order matters. In order to support repository with "/" in them, we
previously added "*" to the repository name named group, allowing it
to capture subsequent "/". When that's the case, it is important that
to general "catch-all" route comes after the more specific routes (e.g
repo manifest). Otherwise, Angular will just eagerly use the first
route that matches a path, even though it may have "better" match in
subsequent routes.

  e.g - '/api/v1/repository/:namespace/:name*'
      - '/api/v1/repository/:namespace/:name*\/tag/:tag'

      In this case, something like
      /api/v1/repository/devtable/testrepo/tag/testtag would match the
      first route, even though if using a weighted system, the second
      route in most case be a better fit.
@kleesc kleesc force-pushed the ui-route-order-for-repo-named-groups branch from d633ab7 to 8f02bf7 Compare August 17, 2021 16:21
@kleesc kleesc merged commit bf81bd9 into quay:master Aug 17, 2021
@kleesc kleesc deleted the ui-route-order-for-repo-named-groups branch August 17, 2021 17:10
kleesc added a commit to kleesc/quay that referenced this pull request Aug 17, 2021
…#872)

Unlike Flask, Angular does not use weights to match paths to routes,
so order matters. In order to support repository with "/" in them, we
previously added "*" to the repository name named group, allowing it
to capture subsequent "/". When that's the case, it is important that
to general "catch-all" route comes after the more specific routes (e.g
repo manifest). Otherwise, Angular will just eagerly use the first
route that matches a path, even though it may have "better" match in
subsequent routes.

  e.g - '/api/v1/repository/:namespace/:name*'
      - '/api/v1/repository/:namespace/:name*\/tag/:tag'

      In this case, something like
      /api/v1/repository/devtable/testrepo/tag/testtag would match the
      first route, even though if using a weighted system, the second
      route in most case be a better fit.
kleesc added a commit that referenced this pull request Aug 17, 2021
* migration: configure logging in alembic's env.py (PROJQUAY-2412) (#875)

Reference: https://alembic.sqlalchemy.org/en/latest/api/config.html#configuration

* ui: change angular routing order for repo paths (PROJQUAY-2325) (#872)

Unlike Flask, Angular does not use weights to match paths to routes,
so order matters. In order to support repository with "/" in them, we
previously added "*" to the repository name named group, allowing it
to capture subsequent "/". When that's the case, it is important that
to general "catch-all" route comes after the more specific routes (e.g
repo manifest). Otherwise, Angular will just eagerly use the first
route that matches a path, even though it may have "better" match in
subsequent routes.

  e.g - '/api/v1/repository/:namespace/:name*'
      - '/api/v1/repository/:namespace/:name*\/tag/:tag'

      In this case, something like
      /api/v1/repository/devtable/testrepo/tag/testtag would match the
      first route, even though if using a weighted system, the second
      route in most case be a better fit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants