Empty LBA why all the configurations must be all equal

While trying to prove the Empty LBA one of the rules says that for having a computational story you have the 3 rules : and one of the 3 rules says that Ci has to produce Ci+1 and all the configurations must be equal like 001#001….001 and I don’t get why. Can anyone help me please ?

forms – Best pattern to tackle optional configurations

I’m working on a project that creates organizations managed by a single user.

Besides the required data (eg: organization name) there are a number of optional configurations:

  • Logo
  • Website URL
  • Social media accounts
  • Other settings and preferences

I’m wondering if there is any research on the best approach to tackle these optional configurations.

Here are the possible ways I see to tackle this:

1) Force users to see the optional fields

I could add more fields to the main form or add a second step with the fields marked as optional. This seems like the most annoying option for users as it has the bigger cognitive load.

2) Let users decide if they want to fill those now or later

Instead of showing all the fields I could ask users if they’d like to fill more details now or later. This seems less annoying but OTOH users may not understand the implications and I’m forcing them to make decision.

3) Simply ignore optional settings and show some tips afterwards

Just force users to fill the minimum required fields and leave the optional settings with their default value. Once the organization has been created I can show something in the UI to let them know they can fill in the additional configurations.

architecture – How to design a system that can manage configurations in a dynamic way efficiently?

I am working on designing a system where I need to manage configuration (config files) in a dynamic way across bunch of application servers. I am working with Consul key value store to manage configurations.

I created below node in consul kv store for the purpose of managing configurations.

{"remoteConfig":"abc-123.tgz", "...."}

Here remoteConfig contains the config file that all the app servers will use (atleast this is the design I got).

Below is what I am trying to do:

  • All the app servers keep a watch on above node in Consul and as soon as value of remoteConfig key changes, they will be notified and then they will download this config and store it on disk.
  • Now once all the app servers in the cluster have downloaded the new config then only we should switch to use new configs in memory across all the boxes in the cluster. If few app servers failed to download then we should not switch to use latest configs in remaining boxes where it was successful.

I am able to do first point easily but I am confuse on how to design my second point efficiently which can help me to switch to latest configs only when all the app servers have downloaded that particular config. I do know on how to atomically update a node by acquiring and releasing lock in Consul but confusion is on how to design it efficiently to handle these cases easily.

Question:

  • How should I design my node in such a way so that it is easier for me to see that all the machines have download this particular config successfully? And it is time now to switch to latest configs on all the boxes.
  • If some machines failed to download a particular config then it should be clear from reading it that this app server failed to download and maybe it can also show timestamp like this app server downloaded this config at this timestamp and they switched to new config at this timestamp.

I don’t have to keep history for all the configs status for each machine, just the latest one will be sufficient. Any other improvements are also welcome in above design to manage the configuration in a dynamic way.

(Note: I can have bunch of other nodes as well (like status node) to do this exercise just fyi. Also instead of Consul, we can use Zookeeper also bcoz lock/leader stuff can be done in both the technologies but for now I am gonna stick to Consul)

Magento 2.4 dev.docs: about recommended Elasticsearch configurations

There are two different recommendations/examples:

  1. "The Magento application and Elasticsearch are installed on different hosts (Running on separate hosts is secure, enables Elasticsearch to be scaled, and is necessary for proxying to work)": https://devdocs.magento.com/guides/v2.4/install-gde/prereq/elasticsearch.html
  2. "Elasticsearch runs on the same host as a web server (The advantage of putting Elasticsearch and the web server on the same host is that it makes intercepting encrypted communication impossible): https://devdocs.magento.com/guides/v2.4/install-gde/prereq/es-config-nginx.html with analog. topic https://devdocs.magento.com/guides/v2.4/install-gde/prereq/es-config-apache.html
    So, what it mean – here no direct recommendations about same or different hosts or machines? Or what, when and how to choose?
    I’m in study now on my own machine (one OS, Apache+Nginx, or may be only Apache). And what should be correct configuration or most effective way for production mode in future?

history – Is the discrepancy in Turing’s representation of complete configurations intentional?

On page 235 of Turing’s 1936 paper, in the figure marked (C), the illustration appears not to match the description. The description states that

space has been made on the left of the scanned symbol, and the m-configuration written in its place

but the illustration shows no scanned symbol for the first complete configuration:

b:əəo0 0:əəq0 0: ... 

It’s hard to tell if this is meant to me something special about the starting state, or a general part of the representation so that one would have

b:əəo0 0:əəq0 0:əə0 q0:əə0 0 q:əə0 0p 1:əə0p 0 1:əpə0 0 1:...

rather than the representation corresponding to the description:

b :əəo0 0:əəq0 0:əə0 q0:əə0 0 q :əə0 0p 1:əə0p 0 1:əpə0 0 1:...

Is there significance to this discrepancy? Is it intentional?

entities – How do I create configurations which describe a list of changes to make to an entity, varying by type and bundle?

I have several kind of content (different Entity Types, possibly different bundles). I have a kind of editorial workflow in which I want to make several changes to a piece of content (an instance implementing ContentEntityinterface). What actual changes I’ll make (which fields, which values) and how (“edit and replace”https://drupal.stackexchange.com/”create revision”https://drupal.stackexchange.com/”clone to new entity”) will depend on.

  • The entity type of provided content (and ideally bundle, although I could cope with a switch)
  • The “kind” of operation in a business perspective (publish / unpublish / revert / clone as draft / etc)
  • Ideally, the “operating mode” (replace/revision/clone), but if that would bring asinine complexity I can circumvent by making different operations for each variation.

Because that configuration may ultimately be managed by non-technical users, and the new values will be “relative to context”, if I follow through with the idea of describing changes, values will have to be “human keywords” that will translate in code to a specific method (ex “publication_date: tomorrow”, “publication_author: site_author)

Finally, while there are specificities to each kind, there are also some “common fields” that will be changed the same way in all kind of entities. Sadly, for reasons, they don’t have the same name.

*For the sake of easing exchanges, let’s say I have the following “entitytype:bundle” available: ‘node:doc’, ‘node:news’, ‘media:image’. I have an operation “publish” which in all entities, affects the following metadata: “publication_date”, “author”, “version number” (business counter unrelated to technical ids), “editorial_state” (unrelated to the Drupal ‘status’).

My very first attempt at structuring configuration made it clear I couldn’t manage with just Simple configuration API.

publication__related_fields:
  - processus_management:
      - node: 'field_moderations_content'
      - media: 'moderation_media'
  - publication_date:
      - node:  'field_begin'
      - media: 'field_begin'
  - publication_author:
      - node:  'uid'
      - media: 'uid'

# Placeholder because later we may actually make some "replace" operations or "new revision" ones.
# For now "copy" translates to "create duplicate of Entity" (yeah, I know... :/)
publication__mode: 'copy'

data_changes_on_publication:
  publication_date: 'today'
  publication_author: 'current_user'

It quickly became obvious to me that I could need to “traverse” configuration either “from operation” or “from entity type” at least. So describing every use-case in a single file would cause headaches one moment or another.

Seems to me it’s a perfect use-case for configuration entities, but while I get the theory of things, I have much trouble wrapping my head around it.

Questions

Could I have configuration entities that would be structured like
mymodule.OPERATION.ENTITY_TYPE.BUNDLE.yml (or maybe ENTITY_TYPE.BUNDLE.OPERATION if you feel it’s more logical)?

How can I then tell to Drupal it has to use this scheming name for the files?
And how can I immediately throw an error and gracefully stop process if provided entity does not have an adequate configuration entity in base?

entities – D8: how to create configurations which describe a list of changes to make to an entity, varying by type and bundle?

Thanks in advance for your advices.

So, context.
I have several kind of contents (different Entity Types, possibly different bundles).

I have a kind of editorial workflow in which I want to make several changes to a piece of content (an instance implementing ContentEntityinterface). What actual changes I’ll make (which fields, which values) and how (“edit and replace”https://drupal.stackexchange.com/”create revision”https://drupal.stackexchange.com/”clone to new entity”) will depend on…

  • The entity type of provided content (and ideally bundle, although I could cope with a switch)
  • The “kind” of operation in a business perspective (publish / unpublish / revert / clone as draft / etc)
  • Ideally, the “operating mode” (replace/revision/clone), but if that would bring asinine complexity I can circumvent by making different operations for each variation.

Because that configuration may ultimately be managed by non-technical users, and the new values will be “relative to context”, if I follow through with the idea of describing changes, values will have to be “human keywords” that will translate in code to a specific method (ex “publication_date: tomorrow”, “publication_author: site_author)

Finally, while there are specificities to each kind, there are also some “common fields” that will be changed the same way in all kind of entities. Sadly, for reasons, they don’t have the same name.

*For the sake of easing exchanges, let’s say I have the following “entitytype:bundle” available: ‘node:doc’, ‘node:news’, ‘media:image’. I have an operation “publish” which in all entities, affects the following metadata: “publication_date”, “author”, “version number” (business counter unrelated to technical ids), “editorial_state” (unrelated to the Drupal ‘status’).

My current state of thoughts.

My very first attempt at structuring configuration made it clear I couldn’t manage with just Simple configuration API.

publication__related_fields:
  - processus_management:
      - node: 'field_moderations_content'
      - media: 'moderation_media'
  - publication_date:
      - node:  'field_begin'
      - media: 'field_begin'
  - publication_author:
      - node:  'uid'
      - media: 'uid'

# Placeholder because later we may actually make some "replace" operations or "new revision" ones.
# For now "copy" translates to "create duplicate of Entity" (yeah, I know... :/)
publication__mode: 'copy'

data_changes_on_publication:
  publication_date: 'today'
  publication_author: 'current_user'

It quickly became obvious to me that I could need to “traverse” configuration either “from operation” or “from entity type” at least. So describing every use-case in a single file would cause headaches one moment or another.

Seems to me it’s a perfect use-case for configuration entities, but while I get the theory of things, I have much trouble wrapping my head around it.

Questions

Could I have configuration entities that would be structured like…
mymodule.OPERATION.ENTITY_TYPE.BUNDLE.yml (or maybe ENTITY_TYPE.BUNDLE.OPERATION if you feel it’s more logical) ?

How can I then tell to Drupal it has to use this scheming name for the files?
And how can I immediately throw an error and gracefully stop process if provided entity does not have an adequate configuration entity in base?

I hope that’s not too broad of a question. Configuration schema is still blurry to me, and Config Entity new. I already checked official doc and some tutorials, and I’ll continue to do so, but every explanation or link to another tutorial/example will be greatly appreciated. Thanks in advance!

debian – Interactions between iptables and ip route configurations

I started learning routing under Linux and confused about configurations that are done using iptables and ip route. I saw a diagram here and here that are about stages that iptables chains and rules activated and used. In these diagrams, in multiple section routing is mentioned. I thought it’s when ip route‘s routes get involved.

Q: I need to know what routes/part of routing (routes that is displayed with command ip route) is activated/used and in what stages?

8 – How to save the configurations in BrowserTestBase?

In a functional test, I try to test a functionality after changing the module configuration:

public function setUp() {
  parent::setUp();
  ...
  $config = Drupal::configFactory()->getEditable('move_file.settings');
  $config->set('vocabulary', 'tags');
  $config->save();
  ...
}

The functionality tested is mainly found in MoveFileService.php. But the service does not see the configs. When I debug the configurations directly in the service, I get:

public function __construct(ConfigFactory $config_factory, LoggerChannelFactoryInterface $logger_factory) {
    $this->config = $config_factory->get('move_file.settings');
    $this->logger = $logger_factory->get('move_file');
}

public static function create(ContainerInterface $container) {
    return new static(
    $container->get('config.factory'),
    $container->get('logger.factory')
    );
}

public function configsAreSet() {
    ...
    fwrite(STDOUT, "Settings: {$this->config->get('vocabulary')}n");
    // Returns: Settings:
    // The configuration is null.

    $config = Drupal::service('config.factory')->getEditable('move_file.settings');
    fwrite(STDOUT, "Settings: {$config->get('vocabulary')}n");
    // Returns: Settings: tags
    // This returns the expected value. But the good practice is to use the dependency injection.
    ...
}

How can I save the configuration in the setUp () method of the functional test, so that the service can obtain the saved configuration, when the test is in progress?

How to make Lombok Builder manage incompatible configurations

How can I use lombok builder to enforce the use of only compatible configurations, as in this answer: How should I manage configurations incompatible with the Builder model? ?

Maybe somehow extend @Builder?