profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/didrocks/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Didier Roche didrocks Canonical Lyon (France) https://didrocks.fr Senior developer, Golang addict, archive admin, working on Ubuntu at @canonical.

canonical/subiquity 272

Ubuntu Server Installer

canonical/ubuntu-wsl-integration 14

Ubuntu WSL Integrations

canonical/ubuntu-wsl-oobe 5

Ubuntu WSL Onboarding Experience

didrocks/canonical-ubuntu-html5-slidedeck 3

Canonical and Ubuntu HTML5 slidedeck (derived from Google I/O ones)

didrocks/dart-polymer-dart-examples 1

Polymer.dart, Web Components, and Dart.

didrocks/go-grpc-middleware 1

Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.

didrocks/appstream-dep11 0

Python module to handle Debian DEP-11 metadata

didrocks/asciinema-local-server 0

Asciinema Local NodeJS Server

pull request commentcanonical/ubuntu-desktop-installer

Build and expose WSL setup

ok, so I withdraw latest commit for the socket change as the CI is heavily depending on it. The issue is that we can’t run (except if we create those symlinks…) on a real system…

This needs to be fixed in a separate PR IMHO and adding also a socket argument to the desktop installer.

Ready for review then!

didrocks

comment created time in 7 hours

PullRequestReviewEvent
PullRequestReviewEvent

push eventcanonical/ubuntu-desktop-installer

push time in 7 hours

pull request commentcanonical/ubuntu-desktop-installer

Build and expose WSL setup

This is not a no-op between the parts, but changing the channel/upgrade is not what is taking most of the time.

I don’t have strong opinion here, but this was to make the separation clearer. If you prefer one part, we can merge them.

didrocks

comment created time in 8 hours

pull request commentcanonical/ubuntu-desktop-installer

Build and expose WSL setup

Converting it as a draft as CI don’t pass. I think I understand the assumption of tests and CI about the socket argument, which is wrong IMHO as it prevents using the real system with it. Maybe it’s better to fix it beforehand on a separate branch.

didrocks

comment created time in 8 hours

PR opened canonical/ubuntu-desktop-installer

Build and expose WSL setup

As we won’t run as part of the snap, and we don’t have a full classic environment, build but don’t expose the binary in the snap.

Ship a script that mimic the desktop extension behaviour, we will have a script in the .deb package that mounts the needed snaps at the right place and ship it where it’s needed.

Ensure finally that the socket is passed to subiquity in dry-run, so that the latter creates the directory if not present.

This was tested and runs on WSL impish.

+623 -1

0 comment

3 changed files

pr created time in 8 hours

PR closed canonical/ubuntu-desktop-installer

Build wsl setup

As we won’t run as part of the snap, and we don’t have a full classic environment, build but don’t expose the binary in the snap.

Ship a script that mimic the desktop extension behaviour, we will have a script in the .deb package that mounts the needed snaps at the right place and ship it where it’s needed.

Ensure finally that the socket is passed to subiquity in dry-run, so that the latter creates the directory if not present.

This was tested and runs on WSL impish.

+623 -1

2 comments

3 changed files

didrocks

pr closed time in 8 hours

pull request commentcanonical/ubuntu-desktop-installer

Build wsl setup

withdrawing this PR, as the branch had one leftover commits which was then taking back multiple commits from main.

didrocks

comment created time in 8 hours

PR opened canonical/ubuntu-desktop-installer

Build wsl setup

As we won’t run as part of the snap, and we don’t have a full classic environment, build but don’t expose the binary in the snap.

Ship a script that mimic the desktop extension behaviour, we will have a script in the .deb package that mounts the needed snaps at the right place and ship it where it’s needed.

Ensure finally that the socket is passed to subiquity in dry-run, so that the latter creates the directory if not present.

This was tested and runs on WSL impish.

+1693 -165

0 comment

32 changed files

pr created time in 9 hours

delete branch canonical/ubuntu-desktop-installer

delete branch : update-instructions-deps

delete time in 9 hours

delete branch canonical/ubuntu-desktop-installer

delete branch : wsl-setup-run-in-snap

delete time in 9 hours

PullRequestReviewEvent

pull request commentcanonical/ubuntu-desktop-installer

WSL Advanced setup: allow mount location end with slash

Tested and it works fine. Thanks! :+1:

jpnurmi

comment created time in 9 hours

PullRequestReviewEvent

pull request commentcanonical/ubuntu-desktop-installer

WSL Profile setup: add input field for "real name"

Tested and it works fine. Thanks! :+1:

jpnurmi

comment created time in 9 hours

PullRequestReviewEvent

Pull request review commentcanonical/ubuntu-desktop-installer

WSL Profile setup: add input field for "real name"

+/// Utility extensions for [String].+extension StringOrIfEmpty on String {+  /// Returns the string if it's not empty, otherwise returns the [other] string.+  String orIfEmpty(String other) => isEmpty ? other : this;++  /// Sanitizes a string for use in user- and hostnames.+  String sanitize() {+    // Replace all non-alphanumeric characters with hyphens.+    var sanitized = replaceAll(RegExp('[^a-zA-Z0-9-]'), '-');+    // Remove leading hyphens.+    while (sanitized.startsWith('-')) {

I don’t have a strong opinon, both rationale makes sense (having the regexp being lighter vs removing the loop) and it was a nitpick :)

Well obviously, I missed the while reading it as an "if" first, but that’s probably only me. Thanks for additional test making it clear it works! :)

jpnurmi

comment created time in 10 hours

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentcanonical/ubuntu-desktop-installer

WSL Profile setup: add input field for "real name"

 part of 'profile_setup_page.dart'; +class _RealNameFormField extends StatelessWidget {

ack, make sense!

jpnurmi

comment created time in 11 hours

Pull request review commentcanonical/ubuntu-desktop-installer

WSL Profile setup: add input field for "real name"

 class ProfileSetupModel extends ChangeNotifier {    /// Whether the current input is valid.   bool get isValid =>-      RegExp(kValidUsernamePattern).hasMatch(username) &&+      realname.isNotEmpty &&       password.isNotEmpty &&-      password == confirmedPassword;+      password == confirmedPassword &&+      RegExp(kValidUsernamePattern).hasMatch(username);

no worry, was just wondering why :)

jpnurmi

comment created time in 11 hours

PullRequestReviewEvent

Pull request review commentcanonical/ubuntu-desktop-installer

WSL Profile setup: add input field for "real name"

+/// Utility extensions for [String].+extension StringOrIfEmpty on String {+  /// Returns the string if it's not empty, otherwise returns the [other] string.+  String orIfEmpty(String other) => isEmpty ? other : this;++  /// Sanitizes a string for use in user- and hostnames.+  String sanitize() {+    // Replace all non-alphanumeric characters with hyphens.+    var sanitized = replaceAll(RegExp('[^a-zA-Z0-9-]'), '-');+    // Remove leading hyphens.+    while (sanitized.startsWith('-')) {

:+1: but you don’t want to remove the while loops I guess?

jpnurmi

comment created time in 11 hours

Pull request review commentcanonical/ubuntu-desktop-installer

WSL Profile setup: add input field for "real name"

+/// Utility extensions for [String].+extension StringOrIfEmpty on String {+  /// Returns the string if it's not empty, otherwise returns the [other] string.+  String orIfEmpty(String other) => isEmpty ? other : this;++  /// Sanitizes a string for use in user- and hostnames.+  String sanitize() {+    // Replace all non-alphanumeric characters with hyphens.+    var sanitized = replaceAll(RegExp('[^a-zA-Z0-9-]'), '-');+    // Remove leading hyphens.+    while (sanitized.startsWith('-')) {

I missed the while loop :p sorry about that. But if you run the regexp to remove all 2+ consecutive hypens first, you don’t need it, correct?

jpnurmi

comment created time in 11 hours

PullRequestReviewEvent

Pull request review commentcanonical/ubuntu-desktop-installer

WSL Profile setup: add input field for "real name"

+import 'package:flutter_test/flutter_test.dart';+import 'package:ubuntu_wizard/utils.dart';++void main() {+  test('if not empty', () {+    expect(''.orIfEmpty('other'), equals('other'));+    expect('not empty'.orIfEmpty('other'), equals('not empty'));+  });++  test('sanitize', () {+    expect(''.sanitize(), equals(''));+    expect('a'.sanitize(), equals('a'));+    expect('abc'.sanitize(), equals('abc'));+    expect(' a b c '.sanitize(), equals('a-b-c'));+    expect('#a€_B@ëc?'.sanitize(), equals('a-b-c'));

So, you should add a test with "#§abc&?" to return "abc" for instance.

jpnurmi

comment created time in 11 hours

Pull request review commentcanonical/ubuntu-desktop-installer

WSL Profile setup: add input field for "real name"

 part of 'profile_setup_page.dart'; +class _RealNameFormField extends StatelessWidget {

You don’t reuse that widget in ubuntu_desktop_installer?

jpnurmi

comment created time in 11 hours

Pull request review commentcanonical/ubuntu-desktop-installer

WSL Profile setup: add input field for "real name"

 class ProfileSetupModel extends ChangeNotifier {   final _password = ValueNotifier('');   final _confirmedPassword = ValueNotifier(''); +  /// The real name for the profile.+  String get realname => _identity.value.realname ?? '';+  set realname(String realname) {+    _identity.value = _identity.value.copyWith(realname: realname);+  }+   /// The username for the profile.-  String get username => _identity.value.username ?? '';+  String get username => _getUserName();   set username(String username) {     _identity.value = _identity.value.copyWith(username: username);   } +  // Returns the current username or a sanitized real name if not set.+  String _getUserName() {+    final username = _identity.value.username ?? '';+    return username.orIfEmpty(realname.sanitize());

I really like the use of the extension here for pre-populating the username, it’s elegant :)

jpnurmi

comment created time in 11 hours

Pull request review commentcanonical/ubuntu-desktop-installer

WSL Profile setup: add input field for "real name"

+/// Utility extensions for [String].+extension StringOrIfEmpty on String {+  /// Returns the string if it's not empty, otherwise returns the [other] string.+  String orIfEmpty(String other) => isEmpty ? other : this;++  /// Sanitizes a string for use in user- and hostnames.+  String sanitize() {+    // Replace all non-alphanumeric characters with hyphens.+    var sanitized = replaceAll(RegExp('[^a-zA-Z0-9-]'), '-');+    // Remove leading hyphens.+    while (sanitized.startsWith('-')) {

Shouldn’t the replaceAll to remove consecutive hyphens be executed before startsWith()/endsWith() calls?

Take this string to sanitize:

"  myname  "
-> "--myname--"
-> "-myname-" (remove leading and trailing hypens)
-> "-myname-" (no double hypens to remove)

This would end up with "-myname-" then?

jpnurmi

comment created time in 11 hours