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

Improvement/2016 brand the dex gui to meet the design #2062

Merged

Conversation

ChengYanJin
Copy link
Contributor

@ChengYanJin ChengYanJin commented Nov 21, 2019

Component: Dex, UI

Context:
As I user, I want to have the same user experience as Metalk8s UI when I log in.

Summary:
We create a configMap and mount it as volume in the web/theme/scality

#!jinja | metalk8s_kubernetes kubeconfig=/etc/kubernetes/admin.conf&context=kubernetes-admin@kubernetes

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: dex-login
  namespace: metalk8s-auth
data:
  styles.css: @@styles
binaryData:
  favicon.png: @@favicon
  logo.png: @@branding

Acceptance criteria:

  1. ./doit.sh vagrant_up
  2. Get the control plane ip
  3. Go to the login page
    https://<control_plane_ip>:8443/oidc/auth?audience=&amp;client_id=metalk8s-ui&amp;redirect_uri=https%3A%2F%2F<control_plane_ip>%3A8443%2Foauth2%2Fcallback&amp;response_type=id_token&amp;scope=openid+profile+email+offline_access&amp;nonce=abcde
    image

Closes: #2016

@bert-e
Copy link
Contributor

bert-e commented Nov 21, 2019

Hello chengyanjin,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Nov 21, 2019

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@gdemonet gdemonet changed the base branch from development/2.4 to development/2.5 November 21, 2019 22:51
@gdemonet
Copy link
Contributor

/after_pull_request=2063

@bert-e
Copy link
Contributor

bert-e commented Nov 21, 2019

Waiting for other pull request(s)

The current pull request is locked by the after_pull_request option.

In order for me to merge this pull request, run the following actions first:

➡️ Merge the OPEN pull request:

Alternatively, delete all the after_pull_request comments from this pull request.

The following options are set: after_pull_request

@gdemonet
Copy link
Contributor

/after_pull_request=2025

@bert-e
Copy link
Contributor

bert-e commented Nov 21, 2019

Waiting for other pull request(s)

The current pull request is locked by the after_pull_request option.

In order for me to merge this pull request, run the following actions first:

➡️ Merge the OPEN pull requests:

Alternatively, delete all the after_pull_request comments from this pull request.

The following options are set: after_pull_request

@gdemonet
Copy link
Contributor

@ChengYanJin you'll need to rebase on development/2.5 once #2063 gets merged (and probably will need the code from #2025 as well)

@ChengYanJin ChengYanJin force-pushed the improvement/2016-brand-the-dex-gui-to-meet-the-design branch from ac37a10 to ab3423d Compare November 22, 2019 11:26
@bert-e
Copy link
Contributor

bert-e commented Nov 22, 2019

Waiting for other pull request(s)

The current pull request is locked by the after_pull_request option.

In order for me to merge this pull request, run the following actions first:

➡️ Merge the OPEN pull request:

Alternatively, delete all the after_pull_request comments from this pull request.

The following options are set: after_pull_request

@ChengYanJin ChengYanJin force-pushed the improvement/2016-brand-the-dex-gui-to-meet-the-design branch 2 times, most recently from 620f955 to cd5391f Compare November 22, 2019 13:54
@ChengYanJin ChengYanJin marked this pull request as ready for review November 22, 2019 14:06
@ChengYanJin ChengYanJin requested a review from a team as a code owner November 22, 2019 14:06
@ChengYanJin ChengYanJin force-pushed the improvement/2016-brand-the-dex-gui-to-meet-the-design branch from cd5391f to ac4518d Compare November 22, 2019 14:23
Copy link
Contributor

@slaperche-scality slaperche-scality left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the buildchain part.
I tested it and it works.

Good job 👍

Copy link
Contributor

@gdemonet gdemonet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes, good job! We'll need to think about a different approach though (I guess fetch the assets from MetalUI directly could work, so that if the theme changes, this one will as well)

Comment on lines +156 to +172
def salt_embed_text(path: Path, indent: int) -> str:
"""Return the content a text file in usable form by Salt."""
data = ['|']
with path.open(encoding='utf-8') as fp:
for line in fp:
data.append('{}{}'.format(' '*indent, line.rstrip()))
return '\n'.join(data)


def salt_embed_bytes(path: Path, indent: int) -> str:
"""Return the content of a binary file in usable form by Salt."""
data = ['|']
bytestring = path.read_bytes()
b64data = base64.encodebytes(bytestring).decode('utf-8')
for line in b64data.split('\n'):
data.append('{}{}'.format(' '*indent, line.rstrip()))
return '\n'.join(data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmpf, that's a strange way to do things. Both could rely on yaml.dump (see 1ada06c for an example of how to customize representers). But let's keep it for a debt ticket.

charts/dex.yaml Show resolved Hide resolved
salt/metalk8s/addons/dex/deployed/login.sls.in Outdated Show resolved Hide resolved
salt/metalk8s/addons/dex/deployed/login.sls.in Outdated Show resolved Hide resolved
The three files will be mounted in web/themes/scality in order to render our customized theme

Refs: #2016
@ChengYanJin ChengYanJin force-pushed the improvement/2016-brand-the-dex-gui-to-meet-the-design branch from ac4518d to 824d2cb Compare November 23, 2019 10:29
@bert-e
Copy link
Contributor

bert-e commented Nov 23, 2019

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following reviewers are expecting changes from the author, or must review again:

The following options are set: after_pull_request

@ChengYanJin
Copy link
Contributor Author

ChengYanJin commented Nov 23, 2019

Minor changes, good job! We'll need to think about a different approach though (I guess fetch the assets from MetalUI directly could work, so that if the theme changes, this one will as well)

Hi Guillaume, thanks for the review!

Actually I fetch different asset for Dexlogin and Metalk8sUI. e.g For scality logo, we use branding.svg => MetalK8s and logo.png => Dexlogin.

The reason is that I need to follow the default file name of Dex.

I moved the dexlogin assets in the ui/public/brand/assets/login. Wondering does it make sense to you?

…urces

- change the buildchain in order to get the content of three UI resource in ConfigMap
- add two function salt_embed_bytes and salt_embed_text to get the good format yaml

Refs: #2016
Generate chart.sls from dex.yaml

Refs: #2016
@ChengYanJin ChengYanJin force-pushed the improvement/2016-brand-the-dex-gui-to-meet-the-design branch from 824d2cb to 572d0d7 Compare November 23, 2019 17:31
@gdemonet
Copy link
Contributor

Actually I fetch different asset for Dexlogin and Metalk8sUI. e.g For scality logo, we use branding.svg => MetalK8s and logo.png => Dexlogin.

The reason is that I need to follow the default file name of Dex.

Oh OK. Actually my point was that, instead of mounting those assets in the Dex container, we could find some way to let them be referenced by URL instead (such URL pointing to Metal UI). But really not urgent. I think I've seen a logoURL configuration option in some examples, for instance.

I moved the dexlogin assets in the ui/public/brand/assets/login. Wondering does it make sense to you?

Yeah it will make sense if we manage to serve them with Metal UI (and not store them in a ConfigMap at build time). So let's keep it, good idea :)

@bert-e
Copy link
Contributor

bert-e commented Nov 25, 2019

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following options are set: after_pull_request

@ChengYanJin
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented Nov 25, 2019

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/2.5

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve, after_pull_request

@bert-e
Copy link
Contributor

bert-e commented Nov 25, 2019

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/2.5

The following branches have NOT changed:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4

Please check the status of the associated issue None.

Goodbye chengyanjin.

@bert-e bert-e merged commit 572d0d7 into development/2.5 Nov 25, 2019
@bert-e bert-e deleted the improvement/2016-brand-the-dex-gui-to-meet-the-design branch November 25, 2019 16:46
extraVolumes:
- name: dex-login
configMap:
name: dex-login
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish we'd have given this a less generic name like dex-scality-theme or whatever.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish we'd have given this a less generic name like dex-scality-theme or whatever.

I will rename it in the 2nd iteration of authentication.

@NicolasT
Copy link
Contributor

NicolasT commented Dec 19, 2019 via email

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.

None yet

6 participants