Permissions on Input Types

A use case I'm interested in is putting permissions on input types and individual fields of input types. This would simplify mutation permissions because you could use a generic mutation like updateUser but limit access to modifying certain fields of User.
Is this supported or possible to add? I'd be happy to contribute if interested.

I'll do some digging this week.

I'm also interested in this feature. I'm just confused. The Readme says:

🎯 Per-Type: Write permissions for your schema, types or specific fields (check the example below).

Are write permissions on fields supported? If yes, how would it be differenet with input types?

Hello, I'm just tackling this issue in my project and I thought I will present it for inspiration.
I would be glad for any pointers how to improve it. Also - I have literally no idea how this construct affect performance and caching...
So my idea is to treat each input field permissions as separate rule and join them with and(). Here's example (using ramda a bit, hope it's still readable)
// Let's prep some syntax sugar

interface FieldRuleMap {
  [key: string]: (field: string) => IRule
}

const fieldRules = (fieldRuleMap: FieldRuleMap) => {
  const rulesArr = Object.entries(fieldRuleMap).map(([key, fn]) => fn(key))
  return and(...rulesArr)
}

// Then define my input field rule

const hasPermission = (fieldName: string) =>
        rule()(async (parent, args, ctx: Context) => {
          // shortcircuit for performance if args has none of this prop
          if (!R.has(fieldName, args)) {
            return true
          }

          // check your privileges
          const res = complicatedCalculations()

          return res
        })

// And voila!

const rulesWithFields: IRules = {
  Mutation: {
    createUser: and(isAuthorized, fieldRules({
      name: hasPermission
    }),
  },
}

const permissions = shield(rulesWithFields)

If you don't mind wall of code - here's some real example - I'm forwarding a lot's of resolvers to Prisma, but I need to check input arguments for connections validity. Here I validate if some target user is a member of the same 'workspace` as user.  It's one-to-many case, for one-to-one I will need to use slightly modified rule.

const verifyConnection = (target: string) => (field: string) =>
  rule()(async (parent, args, ctx: Context) => {
    // shortcircuit
    if (!R.has(field, args.data)) {
      return true
    }

  // I do a lot of this checks so I keep workspaceId in JWT
    const workspaceId = getId(ctx).workspaceId
  // Get id[] from args
    const targetConnect = args.data[field].connect

  // Now I mapping ids to array of promises checking each provided target id
    const validationP = targetConnect.map(connect => {
      return ctx.db.exists[target]({
        AND: {
          id: connect.id,
          workspace: { id: workspaceId },
        },
     // Later I'm using Promise.all() and I want it to stop executing on first `false` so I'm adding reject
      }).then(res => (res === true ? Promise.resolve(true) : Promise.reject('Not Authorized')))
    })

   // Await for all promises and test if all elements yield true
   // (bit unnecessary since I'm rejecting those promises in case of false, but nvm)
    const result = R.all(R.equals(true), await Promise.all(validationP).catch(rej => [false]))

    return result
  })

// same syntetic sugar as previous example
interface ConnectionRuleMap {
  [key: string]: (field: string) => IRule
}

const verifyConnections = (connectionRuleMap: ConnectionRuleMap) => {
  const rulesArr = Object.entries(connectionRuleMap).map(([key, fn]) => fn(key))
  return and(...rulesArr)
}

// rules
export const rules: IRules = {
Mutation: {
    createTask: verifyConnections({
      owners: verifyConnection('User'),
      subscribers: verifyConnection('User'),
    })
  }
}

const permissions = shield(rules)

export default permissions

What y'all think? 😃

@vadistic great inspiration. thanks!
I will look into this, but I would prefer a solution with existing rules. like

	Mutation: {
		createThing: fieldRules({
			field1: deny,
			field2: allow,
		}),
        }

I will write when I figured it out.

@vadistic what is this "R"-Object???

OK. Here my first attempt:

const fieldRules = (fieldRuleMap, path = []) => {
	const rulesArr = Object.entries(fieldRuleMap).map(([key, rule]) => {
		// Has no rule / is object
		if(!(rule.rules && Array.isArray(rule.rules))) {
			return fieldRules(rule, [...path, key])
		}
		// has rule
		return checkRule(key, rule, path)
	})
	return and(...rulesArr)
}

const checkRule = (fieldName, customRule, path) => {
	return rule()(async (parent, args) => {
		try {
			// exit if args dont have this field
			if (!objectValueByPath(args, fieldName, path)) {
				return true
			}
			return customRule
		} catch (error) {
			return false
		}
	})
}

const objectValueByPath = (object, fieldName, path) => {
	let current	= object
	path.forEach(key => {
		if(!current[key]) {
			// false = not in tree
			return false
		}
		current = current[key]
	})
	return current[fieldName]
}

You can use it with

		createThing: fieldRules({
			data: {
				field1: deny,
				subfields: {
				    subfield1: deny,
				}
			}
		}),

what do you all think?

Hey 👋,
I let this discussion evolve itself but I think we steered a bit out of the initial idea. Therefore, I would like to focus on tackling the overall problem that we are addressing not the implementation details themself.
Firstly, I want to clarify what I understood as a proposal to input type scoped permissions. GraphQL allows the definition of so-called input types. Their primary focus is making more complex data structures accessible in arguments and not only in types themselves. An example of input-types usage would be a signup mutation, for example, which accepts multiple arguments. Because data can be nested or in any other way co-dependent, it makes sense to allow JSON-like input structures which we can test before execution (validation step).
Hence, this issue does not address how one should go about implementing scalar arguments validation but rather how we can make permissions on complex cross-field arguments reusable.
To corroborate the idea, let's examine the schema below. At first sight, we can notice we are creating a simple social network where one can create a single or even multiple events at the same time. There's a GroupInput input type that we use in two different places.
type Mutation {
  createGroup(data: GroupInput): Group
  createMultipleGroups(data: [GroupInput!]!): [Group!]!
}

input GroupInput {
  name: String!
  members: [ID!]!
}

type Group {
  id: ID!
  name: String!
  members: [Member!]!
}

Furthermore, groups require a unique name. Currently one would tackle such a problem by implementing the same code in two different places. To give a brief notion of how one could achieve this with the current graphql-shield features, let us examine the following code;
const permissions = shield({
  Mutation: {
    createGroup: rule()(async (parent, { data }, ctx, info) => {
      if (canGroupBeCreated(data)) {
        return true
      }
      return false
    }),
    createMultipleGroups: rule()(async (parent, { data }, ctx, info) => {
      if (data.every(group => canGroupBeCreated(group))) {
        return true
      }
      return false
    }),
  },
})

Horrible!
Now, the idea of this issue is to find a way to make the above syntax far more appealing than the example we just witnessed. To give an idea of what seems the right direction, let's examine the last chunk of code on this particular topic;
const permissions = shield({
  InputTypes: {
    GroupInput: {
      name: val => isUniqueName(val)
    }
  },
  Mutation: {
    createGroup: rule()(async (parent, { data }, ctx, info) => {
      // if (canGroupBeCreated(data)) {
      //   return true
      // }
      // return false
      //
      // We already know that arguments passed - we can focus on other restrictions!
    }),
    createMultipleGroups: rule()(async (parent, { data }, ctx, info) => {
      // if (data.every(group => canGroupBeCreated(group))) {
      //   return true
      // }
      // return false
      //
      // We already know that arguments passed - we can focus on other restrictions!
    }),
  },
})

I hope I made it a bit more clear of what I believe this proposal is aiming for. I hope we can find a genuinely concise and ingenious approach to tackling the problem as I think this could help, as can also be seen from the activeness of the discussion, many developers.
I think I covered the first topic. 😄

Now, the second topic I want to discuss is a response to a comment made by... it seems like it's not here anymore... anyways, I think this is a great place to share it!
With GraphQL you are always querying.
There's been a numerous amount of questions addressing how one could foresee which fields the client is interested in and stop the execution of a query upfront if need be. This has been especially common in two particular scenarios; mutations and resolvers using schemaDelagation. I think this conceptual fatuity is a result of our approach to GraphQL - we are still thinking in REST.
I believe schemaDelegation is quite often considered a somehow similar concept to REST-designed application. However, it is not! It's quite evident why people make this obvious mistake; delegation happens in one of the resolvers, and its result is forwarded to the resolver execution chain. Addressing the issue we can see why the relation seems complementary. Long story short, don't be fooled into thinking schemaDelegation is in any way similar to REST. It's not! Every value returned by the remote server is reprocessed once again locally.
To conclude, we often mingle REST with GraphQL when it comes to schemaDelegation. Nevertheless, they are not the same thing, far from it in fact. Thinking about "foreseeing" requested fields is, therefore, redundant - your logic shouldn't depend on the content of the processed query.
Furthermore, as the quote above humbly suggests, we are always querying. There's no distinct difference between Query and Mutation - in fact, there's only one difference; one is processed serially and the other is processed asynchronously. The beauty of the graph is that one can compose a relational network and ideally access all fields from whichever vertex they desire. Fields have to be independent.
Summing it all up, I believe a notion of "foreseeing" request content and relating function execution based on it is ridiculous. When we make internal changes as a result of arguments of Query or Mutation they shouldn't depend on the queried content.
I hope this is somewhat helpful contribution to our discussion. I would love to hear your thoughts on it as well! 🙂

I believe this might be a good approach to implement permissions on input types https://github.com/jquense/yup.

:tada: This issue has been resolved in version 5.3.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:

Thanks, man! Great feature!

Special thanks from us! This feature will come in very handy to us. We donated something for your work. Thanks again!


500 error when creating an API key

The service log shows the following:
sqlalchemy.exc.ProgrammingError: (MySQLdb._exceptions.ProgrammingError) (1146, "Table 'pdns.apikey_account' doesn't exist")
How do I create this table, and why wasn't it there when I installed pdns-admin a couple of months ago? I guess the first question will be easier to answer than the latter.

Hello,
We need to improve documentation and especially release notes. There are patches that add functionalities and you need to trigger migrations when updating the codebase.
Can you close the issue if the problem is solved ?

A db migration can be triggered by running flask db upgrade.

Hello,
Can you give us a feedback about this issue ? Is it fixed by running the db upgrade ?
Thank you.

flask db upgrade

Hi, that command fails for me:
me@host:~$ cd /var/www/html/pdns/
me@host:/var/www/html/pdns$ sudo -s
me@host:/var/www/html/pdns# source ./flask/bin/activate
(flask) root@host:/var/www/html/pdns# export FLASK_CONF=./configs/production.py
(flask) root@host:/var/www/html/pdns# export FLASK_APP=./powerdnsadmin/__init__.py
(flask) root@host:/var/www/html/pdns# flask db upgrade
Usage: flask db upgrade [OPTIONS] [REVISION]
Try 'flask db upgrade --help' for help.

Error: Could not import "powerdnsadmin.__init__".

I guess I'm still doing something wrong?

The message says it tries to load powerdnsadmin.__init__ while the you used export FLASK_APP=./powerdnsadmin/__init__.py. Can you do ls $FLASK_APP to check if the var has the extension and the file is reachable ?
You can add quote arround the value ?
You can try this oneline as well: FLASK_APP=powerdnsadmin/__init__.py flask db upgrade or FLASK_APP="powerdnsadmin/__init__.py" flask db upgrade
Regards

Sure, here you go:
(flask) root@host:/var/www/html/pdns# ls -l $FLASK_APP
-rwxr-xr-x 1 root root 4275 Mar 14 16:15 ./powerdnsadmin/__init__.py

Removing the './' from FLASK_APP results in the following error:
(flask) root@host:/var/www/html/pdns# export FLASK_CONF=./configs/production.py
(flask) root@host:/var/www/html/pdns# export FLASK_APP=powerdnsadmin/__init__.py
(flask) root@host:/var/www/html/pdns# flask db upgrade
Traceback (most recent call last):
  File "/var/www/html/pdns/flask/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/cli.py", line 967, in main
    cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None)
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/cli.py", line 425, in decorator
    with __ctx.ensure_object(ScriptInfo).load_app().app_context():
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/cli.py", line 388, in load_app
    app = locate_app(self, import_name, name)
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/cli.py", line 257, in locate_app
    return find_best_app(script_info, module)
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/cli.py", line 83, in find_best_app
    app = call_factory(script_info, app_factory)
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/cli.py", line 119, in call_factory
    return app_factory()
  File "/var/www/html/pdns/powerdnsadmin/__init__.py", line 70, in create_app
    app.config.from_envvar('FLASK_CONF')
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/config.py", line 111, in from_envvar
    return self.from_pyfile(rv, silent=silent)
  File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/config.py", line 131, in from_pyfile
    with open(filename, mode="rb") as config_file:
FileNotFoundError: [Errno 2] Unable to load configuration file (No such file or directory): '/var/www/html/pdns/powerdnsadmin/./configs/production.py'

The right path for that file is /var/www/html/pdns/configs/production.py, but how do I fix the reference?

The configuration path should be relative to the app or absolute.
Can you try export FLASK_CONF=../configs/production.py or export FLASK_CONF=/var/www/html/pdns/configs/production.py ?

Ahh, I had used ../ on both exports instead of ./ before but that didn't work. This did:
(flask) root@host:/var/www/html/pdns# export FLASK_CONF=../configs/production.py
(flask) root@host:/var/www/html/pdns# export FLASK_APP=powerdnsadmin/__init__.py
(flask) root@host:/var/www/html/pdns# flask db upgrade
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> 787bdba9e147, Init DB
INFO  [alembic.runtime.migration] Running upgrade 787bdba9e147 -> 59729e468045, Add view column to setting table
INFO  [alembic.runtime.migration] Running upgrade 59729e468045 -> 1274ed462010, Change setting.value data type
INFO  [alembic.runtime.migration] Running upgrade 1274ed462010 -> 4a666113c7bb, Adding Operator Role
INFO  [alembic.runtime.migration] Running upgrade 4a666113c7bb -> 31a4ed468b18, Remove all setting in the DB
INFO  [alembic.runtime.migration] Running upgrade 31a4ed468b18 -><PHONE_NUMBER>77, Upgrade DB Schema
INFO  [alembic.runtime.migration] Running upgrade<PHONE_NUMBER>77 -> 0fb6d23a4863, Remove user avatar
INFO  [alembic.runtime.migration] Running upgrade 0fb6d23a4863 -> 856bb94b7040, Add comment column in domain template record table
INFO  [alembic.runtime.migration] Running upgrade 856bb94b7040 -> b0fea72a3f20, Update domain serial columns type
INFO  [alembic.runtime.migration] Running upgrade b0fea72a3f20 -> 3f76448bb6de, Add user.confirmed column
INFO  [alembic.runtime.migration] Running upgrade 3f76448bb6de -> 0d3d93f1c2e0, Add domain_id to history table
INFO  [alembic.runtime.migration] Running upgrade 0d3d93f1c2e0 -> 0967658d9c0d, add apikey account mapping table

Strangely enough, the issue is back after a git pull to update pdnsadmin. flask db upgrade ran without issue, but I'm getting the following error MySQLdb._exceptions.ProgrammingError: (1146, "Table 'pwrdns.apikey_account' doesn't exist")
How do I create this table and what other tables might I be missing?
Full error here:
Oct 10 12:58:32 host.domain.com gunicorn[34601]: [2022-10-10 12:58:32,539] [app.py:1891] ERROR - Exception on /admin/manage-keys [GET]
Oct 10 12:58:32 host.domain.com gunicorn[34601]: Traceback (most recent call last):
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     self.dialect.do_execute(
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     cursor.execute(statement, parameters)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     res = self._query(query)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/MySQLdb/cursors.py", line 319, in _query
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     db.query(q)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/MySQLdb/connections.py", line 259, in query
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     _mysql.connection.query(self, query)
Oct 10 12:58:32 host.domain.com gunicorn[34601]: MySQLdb._exceptions.ProgrammingError: (1146, "Table 'pwrdns.apikey_account' doesn't exist")
Oct 10 12:58:32 host.domain.com gunicorn[34601]: The above exception was the direct cause of the following exception:
Oct 10 12:58:32 host.domain.com gunicorn[34601]: Traceback (most recent call last):
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     response = self.full_dispatch_request()
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     rv = self.handle_user_exception(e)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     reraise(exc_type, exc_value, tb)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     raise value
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     rv = self.dispatch_request()
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     return self.view_functions[rule.endpoint](**req.view_args)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask_login/utils.py", line 272, in decorated_view
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     return func(*args, **kwargs)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/powerdnsadmin/decorators.py", line 33, in decorated_function
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     return f(*args, **kwargs)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/powerdnsadmin/routes/admin.py", line 395, in manage_keys
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     return render_template('admin_manage_keys.html',
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/templating.py", line 137, in render_template
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     return _render(
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/templating.py", line 120, in _render
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     rv = template.render(context)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/jinja2/environment.py", line 1304, in render
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     self.environment.handle_exception()                                                                                Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/jinja2/environment.py", line 925, in handle_exception
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     raise rewrite_traceback_stack(source=source)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/powerdnsadmin/templates/admin_manage_keys.html", line 2, in top-level template code
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     {% set active_page = "admin_keys" %}
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/powerdnsadmin/templates/base.html", line 192, in top-level template code
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     {% block content %}
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/powerdnsadmin/templates/admin_manage_keys.html", line 49, in block 'content'
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     <td>{% for account in key.accounts %}{{ account.name }}{% if not loop.last %}, {% endif %}{% endfor %}</td>
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/jinja2/environment.py", line 474, in getattr
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     return getattr(obj, attribute)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 287, in __get__
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     return self.impl.get(instance_state(instance), dict_)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 723, in get
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     value = self.callable_(state, passive)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/orm/strategies.py", line 759, in _load_for_state
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     return self._emit_lazyload(
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "<string>", line 1, in <lambda>
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/orm/strategies.py", line 900, in _emit_lazyload
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     q(session)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/ext/baked.py", line 545, in all
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     return list(self)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/ext/baked.py", line 445, in __iter__
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     return q._execute_and_instances(context)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3533, in _execute_and_instances
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     result = conn.execute(querycontext.statement, self._params)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     return meth(self, multiparams, params)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     return connection._execute_clauseelement(self, multiparams, params)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     ret = self._execute_context(
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     self._handle_dbapi_exception(
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     util.raise_(
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     raise exception
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     self.dialect.do_execute(
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     cursor.execute(statement, parameters)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     res = self._query(query)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/MySQLdb/cursors.py", line 319, in _query
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     db.query(q)
Oct 10 12:58:32 host.domain.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/MySQLdb/connections.py", line 259, in query
Oct 10 12:58:32 host.domain.com gunicorn[34601]:     _mysql.connection.query(self, query)
Oct 10 12:58:32 host.domain.com gunicorn[34601]: sqlalchemy.exc.ProgrammingError: (MySQLdb._exceptions.ProgrammingError) (1146, "Table 'pwrdns.apikey_account' doesn't exist")
Oct 10 12:58:32 host.domain.com gunicorn[34601]: [SQL: SELECT account.id AS account_id, account.name AS account_name, account.description AS account_description, account.contact AS account_con
tact, account.mail AS account_mail
Oct 10 12:58:32 host.domain.com gunicorn[34601]: FROM account, apikey_account
Oct 10 12:58:32 host.domain.com gunicorn[34601]: WHERE %s = apikey_account.apikey_id AND account.id = apikey_account.account_id]
Oct 10 12:58:32 host.domain.com gunicorn[34601]: [parameters: (3,)]
Oct 10 12:58:32 host.domain.com gunicorn[34601]: (Background on this error at: http://sqlalche.me/e/13/f405)

Found this code, so now resorting to manually creating the table. But for the foreign key options, which should be used? cascade, restrict, no action, or set null?
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('apikey_account',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('apikey_id', sa.Integer(), nullable=False),
    sa.Column('account_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['account_id'], ['account.id'], ),
    sa.ForeignKeyConstraint(['apikey_id'], ['apikey.id'], ),
    sa.PrimaryKeyConstraint('id')

But after creating the table manually I get a code error:
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]: [2022-10-10 13:28:22,397] [app.py:1891] ERROR - Exception on /dashboard/ [GET]
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]: Traceback (most recent call last):
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     response = self.full_dispatch_request()
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     rv = self.handle_user_exception(e)
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     reraise(exc_type, exc_value, tb)
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     raise value
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     rv = self.dispatch_request()
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     return self.view_functions[rule.endpoint](**req.view_args)
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/var/www/html/pdns/flask/lib/python3.8/site-packages/flask_login/utils.py", line 272, in decorated_view
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     return func(*args, **kwargs)
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/var/www/html/pdns/powerdnsadmin/routes/dashboard.py", line 192, in dashboard
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     detailedHistories = convert_histories(history)
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/var/www/html/pdns/powerdnsadmin/routes/admin.py", line 915, in convert_histories
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     detailedHistories.append(DetailedHistory(histories[i], None))
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/var/www/html/pdns/powerdnsadmin/routes/admin.py", line 767, in __init__
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     detail_dict = json.loads(history.detail)
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     return _default_decoder.decode(s)
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:   File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]:     obj, end = self.scan_once(s, idx)
Oct 10 13:28:22 web07.ixbru.ipnexia.com gunicorn[34601]: json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

This post saved my bacon: https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues/1229#issuecomment-1255711518
I think the DB update stuff after a code update needs a little more work...

For those coming here trying to fix similar stuff: It appears that doing an apt upgrade updates PowerDNS without adding the extra columns into the database: https://doc.powerdns.com/authoritative/backends/generic-mysql.html
So make sure to check the PowerDNS logs as well as if PowerDNS returns a 500 error via the API then pdns-admin passes it up the chain. So don't always assume it's pdns-admin that's the cause of the 500 error.


Get Twilio Paid Account

I have some money on my account we can use.

Temp solution: using my account while in dev. Once deployed will need a general account. @3vivekb will work on getting that

I put 20 bucks into an account.  I'll share creds with you guys.


Welcome bot is still broken

This run https://github.com/freeCodeCamp/freeCodeCamp/runs/6986475254 should have added a comment on https://github.com/freeCodeCamp/freeCodeCamp/pull/46599

Sure I can look in to this today.

https://github.com/freeCodeCamp/freeCodeCamp/runs/7027667856 should have worked for PR https://github.com/freeCodeCamp/freeCodeCamp/pull/46632

The action has only read permissions hence the 403 error. We can either give the write permission only for pull-requests in the workflow file or change the permissions in the repo settings but the later option would mean that all scopes are given write permissions


[Bug]: Not Logout after clicking on it

Is there an existing issue for this?

[X] I have searched the existing issues

Describe the bug
I was reviewing the website and noticed that after clicking on "logout," it does not log out or return to the initial login page. Instead, it directly logs in by fetching the current user data. It should prompt for the email and password to log in again instead of automatically logging in.
Expected behavior
It should return to the logout page with the option to build a resume, which will appear as the initial page of the website.
Add ScreenShots
https://github.com/ashutosh-rath02/git-re/assets/109288720/1bfb21d7-8617-482e-9506-130b9ff2b12b
On which device are you experiencing this bug?
Linux, Chrome, Windows
Record

[X] I have read the Contributing Guidelines
[X] I'm a GSSOC'24 contributor
[X] I have starred the repository

Thank you for creating this issue! 🎉 We'll look into it as soon as possible. In the meantime, please make sure to provide all the necessary details and context. If you have any questions or additional information, feel free to add them here. Your contributions are highly appreciated! 😊
You can also check our CONTRIBUTING.md for guidelines on contributing to this project.

@ashutosh-rath02  Please assign me this issue under labels of gssoc and level2 .

Are you able to find out the cause of this issue?

Hey @ashutosh-rath02  I think .env variables are required to run the project on local host whenever I tried to run project on local host it shows error :
Error: either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!
Can you please help with this ?

You can read the README file to start with these. There's a complete roadmap on setup

@Latish705 Hey , I am working on it but the only problem is this , it is not starting on my lappy frontend start on different page and backend on different page

This issue has been automatically closed because it has been inactive for more than 30 days. If you believe this is still relevant, feel free to reopen it or create a new one. Thank you!

Hello @YukiP7! Your issue #209 has been closed. Thank you for your contribution!


Add SessionSurvey ActionCreator test

Issue

close #715

Overview (Required)

add SessionSurvey ActionCreator Test

Links

Screenshot

Question
Is it unnecessary to test the processMessage function?🤔
https://github.com/DroidKaigi/conference-app-2019/blob/5bab46e145b110a57a16c479a49921e512ebe102/feature/survey/src/main/java/io/github/droidkaigi/confsched2019/survey/ui/actioncreator/SessionSurveyActionCreator.kt#L43

1 Error
feature/survey/src/test/java/io/github/droidkaigi/confsched2019/survey/ui/actioncreator/SessionSurveyActionCreatorTest.kt#L82 - Needless blank line(s)
Generated by  Danger

Sorry
I will do fix tomorrow


chore: dont rely on slice labels

I wanted to proceed a bit on trying to convert thanos to build with stringlabels and prom-label-proxy is used as a library there. This would fix this build error for me!

@MichaHoffmann can you give me a bit more context? How is this code affecting external behavior in the Thanos build?

@squat There is the new "stringlabels" code in Prometheus itself. When switching to this implementation, accessing the slice directly is no longer allowed.

Here's what you get if you build prom-label-proxy now:
$ go build --tags=stringlabels .
# github.com/prometheus-community/prom-label-proxy/injectproxy
injectproxy/rules.go:210:24: cannot range over rule.Labels() (value of type "github.com/prometheus/prometheus/model/labels".Labels)
injectproxy/rules.go:234:23: cannot range over alert.Labels (variable of type "github.com/prometheus/prometheus/model/labels".Labels)

With this change, the build is successful.

@MichaHoffmann can you give me a bit more context? How is this code affecting external behavior in the Thanos build?

What @SuperQ said! Just adding context that I want to convert Thanos to be compatible with the stringlabels tag and there are more build failures, this was just one of them and it seemed easy enough to fix.

And soon -tags dedupelabels - https://github.com/prometheus/prometheus/pull/12304


add k8s secret auth method

Support accessing k8s from kubeconfig, and  fetching private registry auth creds from k8s secret
Fixes: #35

Codecov Report

Merging #97 (db1eb49) into main (490a82d) will decrease coverage by 0.46%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main      #97      +/-   ##
==========================================
- Coverage   28.42%   27.95%   -0.47%
==========================================
  Files          17       18       +1
  Lines        1520     1581      +61
==========================================
+ Hits          432      442      +10
- Misses       1024     1075      +51
  Partials       64       64

Impacted Files
Coverage Δ

pkg/auth/keychain.go
32.55% <0.00%> (-2.45%)
:arrow_down:

pkg/auth/kubesecret.go
0.00% <0.00%> (ø)

cmd/containerd-nydus-grpc/pkg/command/flags.go
76.56% <0.00%> (-1.28%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 490a82d...db1eb49. Read the comment docs.

Can you add your "Signed-off-by"?

@liubogithub I have added.Thanks！

We'd better clean up commits and give some brief commit messages like https://github.com/dragonflyoss/image-service/commit/1407484a959c7ce1b7a847955ff01aa414be86f3. :)


As a developer, I want to migrate the existing algorithm to the new architecture, so it is easier to understand.

Requirements:

Output mask must be identical to the previous output mask.

Define components and docstrings.

Continued improving the new architecture.  Includes automatic timing code.


Important Announcement

Make sure to add problems that are considered important from an interview point of view and those that will help the candidates to get a deeper understanding of DSA concepts.

Hi....
Can I add some problems on binary search ?
Problems:

First and last occurrence of an element in a sorted array.
Count the frequency of an element in a sorted array.
Number of times a sorted array is rotated.
Find the element in an rotated sorted array.


No team data - Jira collector

Using the Jira colletor to get in team data. We use the boards as team option. Somehow this is not working? When I call the endpoint using Postman I do get information. Not clear to me why this part is not working?
2018-02-13 13:40:00,000 INFO  c.c.d.collector.CollectorTask - Running Collector: Jira
2018-02-13 13:40:00,181 INFO  org.mongodb.driver.connection - Opened connection [connectionId{localValue:25, serverValue:704}] to mongodb:27017
2018-02-13 13:40:00,392 INFO  c.c.d.collector.CollectorTask - -----------------------------------
2018-02-13 13:40:00,392 INFO  c.c.d.collector.CollectorTask - https://jira.essent.nl/jira
2018-02-13 13:40:00,392 INFO  c.c.d.collector.CollectorTask - -----------------------------------
2018-02-13 13:40:00,392 INFO  c.c.d.collector.CollectorTask - Team Data               0        0s
2018-02-13 13:40:01,136 INFO  c.c.d.collector.CollectorTask - Project Data           92        0s
2018-02-13 13:40:01,519 INFO  c.c.d.c.story.StoryDataClientImpl - Loop i 0 pageSize 1
2018-02-13 13:40:01,519 INFO  c.c.d.collector.CollectorTask - Story Data              1        0s
2018-02-13 13:40:01,519 INFO  c.c.d.collector.CollectorTask - Finished                         1s

docker-compose file environment config:
      - JIRA_ISSUE_TYPE_NAMES=Story
      - JIRA_SPRINT_DATA_FIELD_NAME=customfield_15433
      - JIRA_EPIC_FIELD_NAME=customfield_11532
      - JIRA_STORY_POINTS_FIELD_NAME=customfield_10002
      - JIRA_BOARD_AS_TEAM="true"

properties file in the docker container:
#Database Name
dbname=dashboard

#Database HostName - default is localhost
dbhost=mongodb

#Database Port - default is 27017
dbport=27017

#Database Username - default is blank
dbusername=db

#Database Password - default is blank
dbpassword=dbpass

#Collector schedule (required)
feature.cron=0 0/5 * * * *

#Page size for data calls (Jira maxes at 1000)
feature.pageSize=1000

#In-built folder housing prepared REST queries (required)
feature.queryFolder=jiraapi-queries

#Jira API Query file names (String template requires the files to have .st extension) (required)
feature.storyQuery=story
feature.epicQuery=epic
feature.projectQuery=projectinfo
feature.memberQuery=memberinfo
feature.sprintQuery=sprintinfo
feature.teamQuery=teaminfo
feature.trendingQuery=trendinginfo

#Jira Connection Details
feature.jiraProxyUrl=
feature.jiraProxyPort=

# Trending Query:  Number of days in a sprint (not-required)
feature.sprintDays=60

# Trending Query:  Length of sprint week (not-required)
feature.sprintEndPrior=7

#Scheduled Job prior minutes to recover data created during execution time (usually, 2 minutes is enough)
feature.scheduledPriorMin=2

#Delta change date that modulates the collector item task - should be about as far back as possible, in ISO format (required)
feature.deltaCollectorItemStartDate=2008-01-01T00:00:00.000000

#Jira Connection Details
feature.jiraBaseUrl=https://<url>/jira
feature.jiraQueryEndpoint=rest/api/2/

#64-bit encoded credentials with the pattern username:password
#on a mac you con create them with : echo "username:password" | base64
#reference:  https://www.base64decode.org/
feature.jiraCredentials=<base64 string>

#OAuth2.0 token credentials (currently not supported in this version)
feature.jiraOauthAuthtoken=sdfghjkl==
feature.jiraOauthRefreshtoken=sdfagheh==
feature.jiraOauthRedirecturi=uri.this.is.test:uri
feature.jiraOauthExpiretime=234567890987

#Start dates from which to begin collector data, if no other data is present - usually, a month back is appropriate (required)
feature.deltaStartDate=2015-03-01T00:00:00.000000
feature.masterStartDate=2008-01-01T00:00:00.000000

# In Jira, general IssueType IDs are associated to various "issue"
# attributes. However, there is one attribute which this collector's
# queries rely on that change between different instantiations of Jira.
# Please provide a String Name reference to your instance's IssueType for
# the lowest level of Issues (e.g., "user story") specific to your Jira
# instance.  Note:  You can retrieve your instance's IssueType Name
# listings via the following URI:  https://[your-jira-domain-name]/rest/api/2/issuetype/
# Multiple comma-separated values can be specified.
feature.jiraIssueTypeNames=Story

# In Jira, your instance will have its own custom field created for "sprint" or "timebox" details,
# which includes a list of information.  This field allows you to specify that data field for your
# instance of Jira. Note: You can retrieve your instance's sprint data field name
# via the following URI, and look for a package name com.atlassian.greenhopper.service.sprint.Sprint;
# your custom field name describes the values in this field:
# https://[your-jira-domain-name]/rest/api/2/issue/[some-issue-name]
feature.jiraSprintDataFieldName=customfield_15433

# In Jira, your instance will have its own custom field created for "super story" or "epic" back-end ID,
# which includes a list of information.  This field allows you to specify that data field for your instance
# of Jira.  Note:  You can retrieve your instance's epic ID field name via the following URI where your
# queried user story issue has a super issue (e.g., epic) tied to it; your custom field name describes the
# epic value you expect to see, and is the only field that does this for a given issue:
# https://[your-jira-domain-name]/rest/api/2/issue/[some-issue-name]
feature.jiraEpicIdFieldName=customfield_11532

# In Jira, your instance will have its own custom field created for "story points"
# This field allows you to specify that data field for your instance
# of Jira.  Note:  You can retrieve your instance's storypoints ID field name via the following URI where your
# queried user story issue has story points set on it; your custom field name describes the
# story points value you expect to see:
# https://[your-jira-domain-name]/rest/api/2/issue/[some-issue-name]
feature.jiraStoryPointsFieldName=customfield_10002

# In Jira, your instance will have its own custom field created for "team"
# This field allows you to specify that data field for your instance
# of Jira.  Note:  You can retrieve your instance's team ID field name via the following URI where your
# queried user story issue has team set on it; your custom field name describes the
# team value you expect to see:
# https://[your-jira-domain-name]/rest/api/2/issue/[some-issue-name]
feature.jiraTeamFieldName=

# Set this to true if you use boards as team
feature.jiraBoardAsTeam="true"

I do not get any error just a 0 that is a bit frustrating I have no indication why it is not working?

@pversteijnen  try giving these values
feature.jiraIssueTypeNames=Story
feature.jiraSprintDataFieldName=customfield_10007
feature.jiraEpicIdFieldName=customfield_10003
feature.jiraStoryPointsFieldName=customfield_10004
feature.jiraTeamFieldName=customfield_11248
feature.jiraBoardAsTeam=true

Yes great that did the trick. Thank you @nireeshT


Page Gives No Help For Response: 302 to ADFS Server

The solution simply doesn't work for me.
I'm just receiving a 302 response with a link to our adfs-Server.
So this got a lot more complicated and it'd be nice if this page provided at least a hint how to do this.
In general, I'd appreciate a section with "what to do when it fails", covering some common cases.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: f9b4c925-3e0f-23c7-1590-c78b92339572
Version Independent ID: dec6ac2e-afca-9527-5ef0-3a19a5f7d9f4
Content: Set up a Postman environment (Developer Guide for Dynamics 365 Customer Engagement)
Content Source: ce/customerengagement/on-premises/developer/webapi/setup-postman-environment.md
Product: d365ce-op
GitHub Login: @phecke
Microsoft Alias: pehecke

Thanks for your comment, @wolfgang720. This issue has been assigned to the doc author for review.

@wolfgang720
Thanks for your feedback.
Were you able to find a solution?
Afraid we didn't encounter that particular error when writing this doc.
If you found a solution, please advise so that we can update the doc.
Since I don't have any details to make a doc change here, I'm going to close this.


BUG: Internal Server Error when there are missing values in the key figures

Missing values in the key figures seems to result in Internal Server Error on Risteys.
Examples:

https://risteys.finregistry.fi/endpoint/E4_PCOS
https://risteys.finregistry.fi/endpoint/GEST_DIABETES

Closing as it appears to work now =)

fixed by 8f45cd27fdb132e9e71405a24a4e95a9835d3e27 and 169b9fd5186e7d189fe66863d30c04a0237f944e


Gadget: Try to replace Android Gadget with mainline

Edit 1:
I've opened this issue to keep track of my experiment in trying to replace the Android Gadget driver with mainline gadget driver.
Also some discussion between developers can take place in this thread, so we can share some ideas and knowledge.
Step 1: Switch over Sysinitv to SystemD. (It's not mandatory, but a lot of scripts which are necessary are written for SystemD, otherwise would need to rewrite a lot). Also we might benefit from using SystemD in boot times as it is a parallel boot manager. It can handle multiple services at the same time, while Sysinitv boots up one after the other.
Step 2: Getting ADB up/running on the modem, or replace adb with OpenSSH exposed through the mainline gadget.
Step 3: QMI: Try to get a QMI interface up and running (Investigate if we can use opensource qmi_wwan driver)

My preference is to use OpenSSH exposed through the mainline gadget driver (Like mobian does) instead of ADB. Try to make the modem as less dependent on android code as possible.

Some additional information about wiring the QMI interface to the USB Serial interface: https://github.com/bacnh85/Quectel_Linux_USB_Driver

Wiring ADB to the mainline USB Gadget driver: https://github.com/openembedded/meta-openembedded/tree/master/meta-oe/recipes-devtools/android-tools/android-tools-conf-configfs

Hello @Biktorgj,
I've been away for some time, but I would like to pick-up this project.
This year I can donate some spare time to this project as this year is a little more quite for me than last year.
I know you are very busy with the current modem as is, and using mainline kernel is not high on you priority list right now, but if I could get this up-and-running we could have a major breakthrough.
The only problem the last time was that my knowledge about the Yocto building is lacking to much to produce buildable images.
Are you willing to guide me through this proces when I have some questions?
I have seen you use Telegram as well, is it okay if I add you there?
Greetings Jasper

Hi Jasper!

Hello @Biktorgj,
I've been away for some time, but I would like to pick-up this project. This year I can donate some spare time to this project as this year is a little more quite for me than last year. I know you are very busy with the current modem as is, and using mainline kernel is not high on you priority list right now, but if I could get this up-and-running we could have a major breakthrough. The only problem the last time was that my knowledge about the Yocto building is lacking to much to produce buildable images. Are you willing to guide me through this proces when I have some questions? I have seen you use Telegram as well, is it okay if I add you there?

Of course, feel free to ping me either in Telegram or Matrix

This is my new plan of approach, tell me what you think about it? - Step 1: Getting ADB running over the mainline gadget driver: This step should be fairly easy. The scripts for it already exist, they are linked in the comment above this one. In this example they use SystemD to initialize everything, but it should be fairly simple to port it over to our init system. It's doing nothing really fancy, only running some basic shell scripts to set-up the gadget driver, and to enable the gadget driver. First I was in favour of using SSH over android interface, but I suspect this will make things very hard with updating modem firmware (like getting in download mode etc.) what do you think? - Step 2: Expose the QMI interface over TTY interface, to be able to let userspace communicate with modem. Greetings Jasper

The current initialization script is here: https://github.com/Biktorgj/meta-qcom/blob/honister/recipes-scripts/usb-normalboot/files/init.d/usb
I did a quick look to ConfigFS in 3.18.140 but never got it to correctly work. I would advise you to start with the current kernel, as going straight to  mainline as it is currently might introduce lots of other problems unrelated to whatever you do, and with 3.18 you have all the other drivers in place and ready.
If you're going to build this you're going to have to build the images lots of times, so if you're using the SDK, let me recommend you some things:

Play with the recovery image (usb init script here: https://github.com/Biktorgj/meta-qcom/tree/honister/recipes-scripts/usb-recoveryboot)
Build a modified recovery image (make recovery_fs) with your custom kernel and use only the recovery slots (fastboot flash recovery [kernel.img]; fastboot flash recoveryfs [your recovery filesystem image], and boot it with 'fastboot oem reboot-recovery'
That way if nothing works you just need to reboot the modem to get it to a working state. It also allows you to then boot to the default image and mount the recovery partition from the main system and modify the image in place instead of having to rebuild everything all the time
Hope it helps!


Authentication service relies on "window" property

The window property relies on the browser, preventing this from being usable with server-side rendering. Might be worth switching the window property to use Angular's Route or ActivatedRoute

This is more difficult than first seemed. One alternative is to use the environment files to set the  callback URLs. The downside is that this would prevent the service from working on any host without configuration.

Fixed in #59 by importing domino into server.
canvas (used by vega) is still not available


Explicitly use showAllTrackers in decideToShowTracker

Addresses: https://keybase.atlassian.net/browse/DESKTOP-234
The code change is really just a small cleanup, I don't think this was really an issue.
I think the issue was just that showAllTrackers was true for me in local-debug.desktop.js.
@keybase/react-hackers @cjb can you see if setting showAllTrackers to false fixes it for you?

:+1:


Resolve the 404 that shows when you click 'download' on the LTU for young people visualisations

Both rolling 3 years and since 1992 show a 404 when you click 'download' rather than providing the raw data (which is the approach we want to see).
Adding blocked to this as it doesn't make sense for us to move on this until we've resolved #176 as these visualisations may change.

Unblocked, LTU visualisations are staying the same

Same issue as #198


Modified Bubble sort with improved time complexity using C++ (GSSOC'21)

🚀 Feature
Have you read the Contributing Guidelines on Pull Requests?
Yes !
AIM :: To make the bubble sort more optimize and adaptive by improved time complexities.
Motivation
As i found the optimized bubble sort in C language but not in C++ , So i am willing to contribute it...
Pitch
Hi I am GSSoC'21 participant,
"I am looking to work on the Modified Bubble sort with improved time complexity issue using C++ #2686”
I will use C++ , as this issue is already present in C language so i am willing to contribute using C++,
I will make the bubble sort more adaptive by using the flag variable
I will write the clean and optimized code , by keeping best case time and space complexity in mind and
with  brief commenting and algorithm.
So i would to like @bhav09 , @HarshCasper sir to please assign this issue to me , so that i can do PR ,
as i have already completed with coding :)
/assign

/assign


How to set no border on images?

I'm not a fan of the black border around the images. Is there a way to disable it?

Hi @martbhell disabling border styling on images is not currently supported but a broader feature that will permit overriding default styling (including things like image borders) is planned and should be available as early as next week. I'll update this thread once that feature goes live.

Great, login forward to it!

Check out the new Wiki documentation on Slideshow Custom CSS for GitPitch presentations. This new feature gives you a lot of power to customize the look and feel of your slideshows, including the ability to remove borders around images.

Thanks! That did the trick :)


az vm image terms documentation not updated

The documentation for az vm image terms has not been updated. It is still showing az vm image accept-terms,

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 90dfc804-87d6-913a-27fe-a9446a04eb13
Version Independent ID: bfcb97df-2055-9eca-7a93-60811136d8cd
Content: az vm image
Content Source: latest/docs-ref-autogen/vm/image.yml
Service: virtual-machines
GitHub Login: @rloutlaw
Microsoft Alias: routlaw

Compute

In fact, the document of az vm image terms command already exists. doc link

If there are no other questions, I will close the issue first. If there are any other questions later, we will reopen it


Compilation warning with clang ++

xxx/build/geodiff/1.0.6/geodiff/src/changeset.h:65:5: warning: non-void function does not return a value in all control paths [-Wreturn-type]     }     ^

/Users/peter/Projects/quick/input-sdk/build/ios/build/geodiff/1.0.6/geodiff/src/changesetutils.cpp:332:1: warning: non-void function does not return a value in all control paths [-Wreturn-type] } ^


Missing editortitledelim?

As far as I can see it would be a nice option to modify the delimiter between the editor-string (Hrsg.) and the title.
It seems to be . by default but sometimes , is required instead.

Ok, that was too easy:
\DeclareFieldFormat{editortype}{\mkbibparens{#1}\addcomma}
so probably no need for an editortitledelim?!

Mhhh, I really don't like \DeclareFieldFormat{editortype}{\mkbibparens{#1}\addcomma} including punctuation commands in field formats and thereby bypassing the punctuation trackers is not what I would consider good style. I try to avoid that if at all possible.
What style are you thinking about? For authoryear nameyeardelim would be triggered between editor and year and all other styles should have nametitledelim there. Granted, that is common to all names, not just editor.
Can you please give a short MWE that shows what you are thinking of?

You are right. It was rarer a hack then clean code.
The background of all me asking is that I have been asked for help to code that specific style: https://github.com/LukasCBossert/biblatex-socialscience-huberlin/blob/master/Beispiel_Literaturverzeichnis.pdf
I set up an repository https://github.com/LukasCBossert/biblatex-socialscience-huberlin and there you find a MWE (https://github.com/LukasCBossert/biblatex-socialscience-huberlin/blob/master/socialscience-huberlin.tex). (The thing is that I have to modify cleanthesis.sty and overwrite its settings but the style [once it coded] should also work 'standalone')
If you find some time to look at it it would be great.

It would be awfully inconsistent to treat an editor differently from an author in that respect and the PDF does not have an example of an @inbook, so I assume you could get away with
\DeclareDelimFormat[bib,biblist]{innametitledelim}{\addcomma\space}

I wasnt aware of [bib,biblist] (must have missed it the documentation). I am still gathering more test-data finding out if @inbook has to be respected, too.

The problem here is that innametitledelim (like nametitledelim) has different definitions for bib,biblist and citation contexts. So in this case we had to redefine the bib and bibllist context explicitly. Turns out I hadn't documented innametitledelim at all. Coming up...

Thank you very much for the hint. This is documented now.
I'm running into a bit of a potential name inconsistency/clash here, so I may have to rename some delimiters or macros.... Hopefully not, we'll see...

Very nice.
Well I was rather looking all the examples first searching what I need to modify and then looking at the name.
So I think having many examples makes it easier to understand the names.

biblatex-ext v0.3 has been released. Many of your helpful suggestions about the manual have been included (I hope). Thank you for your help.
editortypedelim will not be implemented because there are other macros already that should be able to do the job you had in mind consistently for authors and translators as well. That should wrap this issue up.

I thank you for all the help!


WIP [test] Gridtools mini app test

Hello @ChristopherBignamini, Thank you for submitting the Pull Request!

In the file cscs-checks/libraries/gridtools/gridtools_base.py:

Line 11:66: E261 at least two spaces before inline comment
Line 11:80: E501 line too long (81 > 79 characters)
Line 12:80: E501 line too long (119 > 79 characters)
Line 13:65: E261 at least two spaces before inline comment
Line 13:66: E262 inline comment should start with '# '
Line 13:80: E501 line too long (101 > 79 characters)
Line 14:80: E501 line too long (103 > 79 characters)
Line 16:80: E501 line too long (141 > 79 characters)
Line 26:67: W291 trailing whitespace
Line 27:76: W291 trailing whitespace
Line 36:80: E501 line too long (140 > 79 characters)
Line 46:80: E501 line too long (80 > 79 characters)
Line 47:66: W291 trailing whitespace
Line 48:75: W291 trailing whitespace
Line 49:80: E501 line too long (82 > 79 characters)
Line 50:80: E501 line too long (80 > 79 characters)
Line 54:80: E501 line too long (82 > 79 characters)
Line 56:80: E501 line too long (81 > 79 characters)
Line 59:9: E303 too many blank lines (2)
Line 68:77: W291 trailing whitespace
Line 102:9: E122 continuation line missing indentation or outdented
Line 114:9: E122 continuation line missing indentation or outdented
Line 126:9: E122 continuation line missing indentation or outdented
Line 128:1: E302 expected 2 blank lines, found 1
Line 135:80: E501 line too long (82 > 79 characters)
Line 136:80: E501 line too long (132 > 79 characters)
Line 137:80: E501 line too long (141 > 79 characters)
Line 148:67: W291 trailing whitespace
Line 149:76: W291 trailing whitespace
Line 180:9: E122 continuation line missing indentation or outdented

Do see the ReFrame Coding Style Guide

Codecov Report

Merging #760 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #760   +/-   ##
=======================================
  Coverage   91.52%   91.52%
=======================================
  Files          76       76
  Lines        9548     9548
=======================================
  Hits         8739     8739
  Misses        809      809

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df7a617...06b493c. Read the comment docs.

@ChristopherBignamini Is this still a WIP?

@jenkins-cscs retry daint

@jenkins-cscs retry none


Bug: On Update Incident trigger isn't working when the incident state value is changed

Describe the bug
"On Update Incident" trigger does not work when the current value of the incident is changed without using the "edit incident" button (ex: Acknowledge Incident).
!! This is only valid when the "listen on" field is filled in the trigger value
To Reproduce
Steps to reproduce the behavior:

Set up a workflow with "On Update Incident" trigger
Go to an "Identified" incident
Click on "Acknowledge Incident"
Workflow did not work even though Incident was updated. Workflow works only when "edit incident" button is used.

Expected behavior
When ı click on "Acknowledge Incident" I expect the trigger to run on "Update Event"
Screenshots
Our workflow with  "On Update Incident" trigger

Our trigger inside

Our "Identified" incident

When we click on "Acknowledge Incident"

Workflow did not work even though Incident was updated
Desktop (please complete the following information):
OS: MACOS 14.0
Browser: chrome
Version release, after Commits on Jan 12, 2024
Smartphone (please complete the following information):

Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]

Deployment Type
Is this issue on my server
Additional context
Add any other context about the problem here.
I think that the Workflow section is the biggest area of freedom in the system, and I believe that it needs to be improved in terms of user experience.

Can you please change Listen on to:
{
   "title": true
}

and it should work. Please reopen if it still does not work

Thank you for your interest.
As a small test note:
It works when I use "currentIncidentStateId" but not when I use "currentIncidentState entity name".


change macos CI latest -> 13 (x64).

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (c58740a) to head (f3d751e).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff            @@
##              main       #51   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files            5         5
  Lines          293       293
  Branches        59        61    +2
=========================================
  Hits           293       293

Flag
Coverage Δ

unittests
100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


error when loading the pretrained Encoder4Editing ffhq encoder

Hello,
Thanks for providing the code.
When I use the pre-trained ffhq encoder, I stumble upon the following error
RuntimeError: Error(s) in loading state_dict for Encoder4Editing:
	Unexpected key(s) in state_dict: "styles.16.convs.0.weight", "styles.16.convs.0.bias", "styles.16.convs.2.weight", "styles.16.convs.2.bias", "styles.16.convs.4.weight", "styles.16.convs.4.bias", "styles.16.convs.6.weight", "styles.16.convs.6.bias", "styles.16.convs.8.weight", "styles.16.convs.8.bias", "styles.16.convs.10.weight", "styles.16.convs.10.bias", "styles.16.linear.weight", "styles.16.linear.bias", "styles.17.convs.0.weight", "styles.17.convs.0.bias", "styles.17.convs.2.weight", "styles.17.convs.2.bias", "styles.17.convs.4.weight", "styles.17.convs.4.bias", "styles.17.convs.6.weight", "styles.17.convs.6.bias", "styles.17.convs.8.weight", "styles.17.convs.8.bias", "styles.17.convs.10.weight", "styles.17.convs.10.bias", "styles.17.linear.weight", "styles.17.linear.bias".

Can you please let me know if you know how to resolve this issue? Thanks!

Hi @ArashVahabpour!
This is caused by a wrong opts.stylegan_size value in the following line:
https://github.com/omertov/encoder4editing/blob/1f27dfc64b1f5567aea5b67018804e7daf961ef6/models/encoders/psp_encoders.py#L146
(according to the exception it seems like it is set to 512 while it should be 1024)
Perhaps the 1024 value in the checkpoint is being overriden by the script you are running, can you elaborate which script it is?
(On a previous commit we fixed a bug in which if your dataset type contained the string 'car' it would override the stylegan_size value to 512, perhaps pulling the latest code will help)
Best,
Omer


Remove uncommented code in Async.Parallel

While discussing Asnyc.Choice implementations with @dsyme and @eiriktsarpalis I wondered about that uncommented line. It confused me and Eirik suggested this unit test to see if things cancel properly.
=> we should remove the uncommented line to avoid confusion

Just to eliminate all confusion, I think you mean "remove the commented line" ;)

lol. that's lost in translation. In german we say "auskommentiert" but which better translates to "commented out" ;-)

Merged, Thank you for your contribution
Kevin


[Bug]: Glitching of some show hide opperations

Guidelines

[X] I agree to follow this project's Contributing Guidelines.

Project Version
current
Platform and OS Version
Windows 11, Chrome
Existing Issues
No response
What happened?
There are some features that appear to flash at the user on startup, for example the progress bars "signal_progress", "correlation_progress", "match_progress", even though we have toggle options set.
Steps to reproduce
Run the app, difficult to get an image.
Expected behavior
No flashing.
Attachments
No response
Screenshots or Videos
No response
Additional Information
No response

Fixed.


MYSQL ensureusers password doesn't work, unable to login to mysql

Describe the bug
Can't login into mysql with password
To reproduce
# devenv.nix

{ pkgs, lib, config, inputs, ... }:

{

  services.mysql = {
    enable = true;
    initialDatabases = [
      { name = "database"; }
    ];
    ensureUsers = [
      {
        name = "root";
        password = "rtpw1111";
        ensurePermissions = {
          "*.*" = "ALL PRIVILEGES";
        };
      }
    ];

  };
}

when i try to use mariadb -u root -p to login with rtpw1111
it returns Access denied for user 'root'@'localhost' (using password: YES)
Version
1.0.5

I encountered same bug within version 1.0.8.


How can i add Double values to graph?

This can be solved by setting referenceLineNumberOfDecimalPlaces on the ReferenceLines instance.


When I ran the file ‘run_pretraining.py’, there was a problem

running on Windows：
‘ERROR:tensorflow:Error recorded from training_loop: corrupted record at 0
[[node IteratorGetNext (defined at C:\Users\root\Anaconda3\envs\albert\lib\site-packages\tensorflow_core\python\framework\ops.py:1748) ]]
Original stack trace for 'IteratorGetNext':’

How did you solve it?

How did you solve it?
It seems to be the version，It's too long to remember。

Thank you for your quick reply!
I will work on it.

May I have your pip freeze for that?
I have done "pip install -r albert/requirements.txt" but still the same.
Thanks a lot!

May I have your pip freeze for your project?
I have done "pip install -r albert/requirements.txt" but still the same.
Thanks a lot!

This project has been modified many times, and Albert is no longer used。I'm very sorry about this.

It's ok.
Thanks for your reply!


Upgrading Chaos to 0.6.3 (env variables for http auth and ssl)

LGTM, just one comment to be addressed.

Thanks for catching that error! Now fixed to just "lib". Awesome!

:+1:


Update the uptime sensor for when new UI is launched

The current sensor for the current registry is working as intended, although it does not have the best implementation and is prone to breaking.
We can avoid the issue of the sensor breaking with a more robust/appropriate check.
Transactional vs HTTP GET ?
Talk to Billy when updating the sensor
-DOD:

[ ] Successfully implemented a new sensor for the New UI that is not as prone to breaking
[ ] Internally document the sensor for future reference

We decided to have a discussion later. Maybe add Terraform script to manage it.


OpenReview scripts?

I found myself creating a small script to convert OpenReview IDs to preferred emails based on the guidance in the OpenReview FAQ. I'm including for reference below. Does it make sense to include somewhere here, or should we start an OpenReview repo separately?
from pathlib import Path

import openreview

def authorids2emails(authorids, client=None, sep=';'):
    authorids = authorids.strip().split('|')
    emails = []
    for author in authorids:
        if '@' in author:
            emails.append(author)
        else:
            profile=client.search_profiles(ids=[author])[0]
            emails.append(profile.content.get('preferredEmail', profile.content['emails'][0]))
    return sep.join(emails)

def main(args):
    # Establish the OpenReview client
    client = openreview.Client(
        baseurl='https://api.openreview.net',
        username=args.username,
        password=args.password,
    )

    with open(args.authorids) as fp:
        for authorids in fp:
            print(authorids2emails(authorids, client=client))

if __name__ == '__main__':
    import argparse

    parser = argparse.ArgumentParser(description="Convert file of OpenReview author IDs to preferred emails")
    parser.add_argument('--username', type=str, required=True)
    parser.add_argument('--password', type=str, required=True)
    parser.add_argument('authorids', type=Path)
    args = parser.parse_args()

    main(args)

Example usage:
python python authorids2emails.py \
    --username=${OPENREVIEW_USER} \
    --password=${OPENREVIEW_PASS} \
    all_emails.txt

If we are planning on sticking with openreview, it might be worth putting this into a new openreview repo? At some point perhaps we could create a simple console for running the scripts.


Allows the webserver's write buffer size to be set to 0

Description
Allows the webserver's write buffer size to be set to 0 (or less). The underlying output stream shall not be wrapped into a buffered output stream one unless this value is greater than 0. See issue #9276.

I guess the PR #9277 concerning the same issue can be closed as well then.

I guess the PR #9277 concerning the same issue can be closed as well then.

Sorry, was not aware of that PR. I guess so then.

Edit: Out of curiosity: I noticed you still wrap the OutputStream even in the unbuffered case. I know that this is not really significant but is the additional heap allocation of the wrapper really necessary?

Where is that exactly?

Oh it's no problem at all. I'm happy that my issue gets fixed and glad for all the work people like you are putting in. I hope you don't mind my minor nitpick about the wrapping. The only reason I'm interested is that for the PR I proposed, no ClosingBufferedOutputStream is created if the buffer size is 0 (which was basically the situation before the buffer was introduced in the first place). But I'm not sure if the wrapper is needed further down the line, because I only have superficial familiarity with the code base.

Yes, ClosingBufferedOutputStream is needed. Hopefully the PR addresses your use case. Should be in 4.1.2.


Add Device Support : Tuya TS0601 - TZE200_81isopgh - Garden Watering System

closes #1556
One question: I used a "FlowMeasurement" to report a Volume of water consumed.
Is this right ? Or should I use something else ?

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

28 of 49 (57.14%)  changed or added relevant lines in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage decreased (-0.2%) to 80.152%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

zhaquirks/tuya/ts0601_garden.py
28
49
57.14%

Totals

Change from base Build<PHONE_NUMBER>:
-0.2%

Covered Lines:
5468

Relevant Lines:
6822

💛  - Coveralls

Codecov Report

Merging #1560 (80ce773) into dev (b802c1f) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev    #1560      +/-   ##
==========================================
+ Coverage   80.31%   80.38%   +0.06%
==========================================
  Files         227      228       +1
  Lines        6773     6797      +24
==========================================
+ Hits         5440     5464      +24
  Misses       1333     1333

Impacted Files
Coverage Δ

zhaquirks/tuya/ts0601_valve.py
100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b802c1f...80ce773. Read the comment docs.

The code in this PR looks suspiciously similar https://github.com/zigpy/zha-device-handlers/pull/1450/

Thanks Simon. Pretty nice work.

I had to make a change and remove the metering cluster because the SmartEnergy purpose is for Energy in kW and not in L
Error from HA : "WARNING (Recorder) [homeassistant.components.sensor.recorder] sensor.arrosage_smartenergy_metering_summation_delivered has unit L which is unsupported for device_class energy"

Can you add back the metering and just add a constant attribute for unit of measurement

I had to make a change and remove the metering cluster because the SmartEnergy purpose is for Energy in kW and not in L
Error from HA : "WARNING (Recorder) [homeassistant.components.sensor.recorder] sensor.arrosage_smartenergy_metering_summation_delivered has unit L which is unsupported for device_class energy"

Does the device measure total sum used or instant demand (flow rate in this case)

I had to make a change and remove the metering cluster because the SmartEnergy purpose is for Energy in kW and not in L
Error from HA : "WARNING (Recorder) [homeassistant.components.sensor.recorder] sensor.arrosage_smartenergy_metering_summation_delivered has unit L which is unsupported for device_class energy"

Does the device measure total sum used or instant demand (flow rate in this case)

Should be the total sum (should because my device has hardware issue so I cannot test it, always at 0)

Can you add back the metering and just add a constant attribute for unit of measurement

I reverted to to previous version that already has the constant attribute.
I think this is more a HA change to be done to manage the L.

Yep I’ll look at that part

@simonbaudart , with all threads related to this Garden Watering Valve, I have difficulties identifying latest code and qwirk. Do you know where is the latest? From discussions, it looks to be finalized, but doesn't seem to have been integrated into any release of ZHA since the time it was closed. Any help would be welcome. Thanks


How to deploy multiple Prometheus-adapters in the same k8s cluster？

Hi. I would like to ask whether it is supported to deploy multiple Prometheus-adapters in the same cluster.
In my cluster, the knative has defined an apiservice named custom.metrics.k8s.io/v1beta1 for HPA.
root@ubuntu:/workspace/gospace# kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1 |jq
{
  "kind": "APIResourceList",
  "apiVersion": "v1",
  "groupVersion": "custom.metrics.k8s.io/v1beta1",
  "resources": [
    {
      "name": "revisions.serving.knative.dev/concurrency",
      "singularName": "",
      "namespaced": true,
      "kind": "MetricValueList",
      "verbs": [
        "get"
      ]
    },
    {
      "name": "revisions.serving.knative.dev/rps",
      "singularName": "",
      "namespaced": true,
      "kind": "MetricValueList",
      "verbs": [
        "get"
      ]
    }
  ]
}

I realized GPU metrics collection through prometheus-exporter, and now I want to deploy a Prometheus-adapter to achieve HPA
for GPU idle rate.  How should I deal with related applications？I could make sure knative applications and
Prometheus-adapter can run normally.
I try to modify the groupversion to v1beta1.gpu.custom.metrics.k8s.io, but it doesn't work properly.
apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
  name: v1beta1.gpu.custom.metrics.k8s.io
spec:
  service:
    name: custom-metrics-apiserver
    namespace: custom-metrics
  group: gpu.custom.metrics.k8s.io
  version: v1beta1
  insecureSkipTLSVerify: true
  groupPriorityMinimum: 100
  versionPriority: 100

Thanks for helping me to solve this.

If you want to use the custom metrics API, you can only do so via the custom.metrics.k8s.io aggregated API, you cannot extend it in any way. Also, you can only bind one aggregator per apiservice, which means that if you are using one prometheus-adapter instance that serve this endpoint, no other instance will be able to serve it. So to answer your original question, it is not possible to deploy multiple prometheus-adapter instances for your particular use case as only one will be able to serve the custom metrics API.
Why do you need 2 instances in the first place? Couldn't you achieve the same result with only one prometheus-adapter instance serving both your knative metrics and your gpu metrics? You could then select the metrics you want to autoscale on directly in your HPA configurations.

@dgrisonnet Thanks for your reply.
My scenario is that two components use the same apiservice. One is the knative application deployed by kubeflow, and the other is Prometheus-adapter.
The knative application already exists in my cluster, which is occupies custom.metrics.k8s.io to achieve HPA. Now I want to deploy a Prometheus-adapter to collect GPU metrics and implement HPA through the GPU metrics. What should I do  to make knative application and Prometheus-adapter not affect each other.

@UrmsOne you can't do that yet, but this is being investigated in https://github.com/kubernetes-sigs/custom-metrics-apiserver/issues/70.
/remove-lifecycle stale